Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp617280pxj; Thu, 13 May 2021 12:41:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKaBe+tgPRGmJGc1plZZDv9EWpIiVDKiloeQKasWJtEgB6ukt7UYFK5MfuTcdSCSRp66cx X-Received: by 2002:a17:907:1b20:: with SMTP id mp32mr45995628ejc.495.1620934902383; Thu, 13 May 2021 12:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620934902; cv=none; d=google.com; s=arc-20160816; b=UpOUekr640djf7LHnOx+L6wz6VPaWgfC0rsI4wjys/nUx5sqJ5mBpxg+djVftD6Ef7 fVEUNywZLFR7ONtqso+sUE2YBU/F+H3kVjNnXwH90RczG636LVtOXC6iwt4kg2HwHExt Dp5k5EI5OvWYDIw8HZTvdpe0fXG2gXZt2E5Rwd/k0bOUTfKQhLvb2m36Es7kqo3klYoZ y4BcmfZQqHceTgfch04JOvZ28eYn00We8O7R6ZUgfAZGMaM9RicPsbw1H90Je1KOYxGK 3GzVTjUKyjKgve8BvFfS5ibvCZ0fc/2G5ID/4ZpveXnLh1+9P2JoJ2OMl2eMYxAvv/JW qfEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:from:dkim-signature; bh=53VrDc7yaURaIAvZgMf9bgQZDAm6RoNVwGpY4UD/pBM=; b=gr6sL6r9KRuDMp0P6JzoLaC8bumGM2MyT/z1ix8L+PuAq2Bp/5drAwsSX+TlKgWjfe x+MNVpIzNFzW2zco4V9OcpXqiYk4hccsIk+O0r4NmYMfRv5HXEfUvOoGx5PXlVgfH8Ke uS0L9AhqXQ9l7lfgu+vky6ujK6Y9GiC/RN9QAFPAzWXgTS0+zZApwa5yrA+x+aVec+nR 8eSaNPJ6+TKqlblGstI/04cTppT2MuX2EEPVKByV9Thcq+sScRMbrHKqyaPv0BBvAXQR fw1rcFmmPQj+dliDkTBSRrb4X7R1i5imhLfoydHHGeSF4RDuVjsJXrepXogN7slgsJ6R bN7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dKm7K0GZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z22si4645776edm.203.2021.05.13.12.41.18; Thu, 13 May 2021 12:41:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dKm7K0GZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234097AbhEMNlU (ORCPT + 99 others); Thu, 13 May 2021 09:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234024AbhEMNlE (ORCPT ); Thu, 13 May 2021 09:41:04 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4FC8C061574 for ; Thu, 13 May 2021 06:39:53 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id b21so14428456plz.0 for ; Thu, 13 May 2021 06:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:mime-version:content-id:date:message-id; bh=53VrDc7yaURaIAvZgMf9bgQZDAm6RoNVwGpY4UD/pBM=; b=dKm7K0GZsyoCl0Zl/bWvwIGL7Of4R0n9eBipNSS/17LsbmjHYWBLhXfk6Y0kNu9qWD cgk+zhrhanxSey77CTsrVODiQ6rUEWkvaxxrtfkPvAsESaGFUPBkRrn3LZJdV8meN5xf Hh0sGe1+xALlDdKpGmcLuisopEgsJpYGpE+oUN2vaAaMUUG0td7msYazg4F4gD7Mqhqw iJcHgri20pTlcscRNo4hyqAxSpnGyPcLkIl5IiBgcEID6UdCc+UshL32hHDGsObOKTd5 Czit2Xcfu+QZlofJUOp/Lg+Ax7LSsx35WMgQJ+qabAwDzWoplhvkt8WbE3F4N7Pszm11 PrBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:mime-version:content-id:date :message-id; bh=53VrDc7yaURaIAvZgMf9bgQZDAm6RoNVwGpY4UD/pBM=; b=R79Sbu59eUhfK6KwdkpL0ZGC9O+XfgEAEDR2h3ADUMChVkJYC4AQnkqAPbTrHfGvUZ xnzVKERN4JoyBN0jm9XLlGmrmb/LCEbgqXUH20EA+LDZR+Yi3ehfH7gK68NuThVpABqo rPZFh10oKTBV5fJ1oUaAZ80oWNrYVjK31bVPD9/hy3bJvduw0fARgWN341leK0bP/kGW F/cGWClRbHlYno06FXFmiWXx3yiPy9fD9Zws94+0Blhi4IRtEiL6/zjVYCc+evTsmcxL YmHwlpkM+qiHmk/pXK4LLghb07CRIO9/NF5gs10v/wRn9VMXnJFuaH4luEoriYechcKa lMDw== X-Gm-Message-State: AOAM532FcIw/OFcg8vp/7dUR4vaD58Z1vSPmX1gu+GsyZA13RjI/UV3v LNb0emntswYne0164RKEGjdjTIcuD5I= X-Received: by 2002:a17:903:208b:b029:ed:74ad:4c15 with SMTP id d11-20020a170903208bb02900ed74ad4c15mr40630894plc.6.1620913193436; Thu, 13 May 2021 06:39:53 -0700 (PDT) Received: from jrobl (h219-110-108-104.catv02.itscom.jp. [219.110.108.104]) by smtp.gmail.com with ESMTPSA id t14sm2071701pfg.168.2021.05.13.06.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 May 2021 06:39:53 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=jrobl) by jrobl id 1lhBZ9-00080i-LW ; Thu, 13 May 2021 22:39:51 +0900 From: "J. R. Okajima" To: peterz@infradead.org, penguin-kernel@I-love.SAKURA.ne.jp Cc: linux-kernel@vger.kernel.org Subject: LOCKDEP customizable numbers upper limit MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30794.1620913191.1@jrobl> Date: Thu, 13 May 2021 22:39:51 +0900 Message-ID: <30795.1620913191@jrobl> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, According to the commit in v5.13-rc1, 5dc33592e9553 2021-04-05 lockdep: Allow tuning tracing capacity constants. several lockdep numbers have their own range as 10--30. But if we set all 30s, we got a compilation error. kernel/locking/lockdep.c:3536:2: note: in expansion of macro 'BUILD_BUG_ON' BUILD_BUG_ON((1UL << 24) <= ARRAY_SIZE(chain_hlocks)); kernel/locking/lockdep.c ---------------------------------------- static u16 chain_hlocks[MAX_LOCKDEP_CHAIN_HLOCKS]; ::: BUILD_BUG_ON((1UL << 24) <= ARRAY_SIZE(chain_hlocks)); ::: ---------------------------------------- MAX_LOCKDEP_CHAIN_HLOCKS is defined in kernel/locking/lockdep_internal.h as this. #define MAX_LOCKDEP_CHAINS_BITS CONFIG_LOCKDEP_CHAINS_BITS #define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS) #define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5) I don't know what this 'multiply by 5' means and why ARRAY_SIZE(chain_hlocks) is limited to (1UL << 24), but setting 30 to CONFIG_LOCKDEP_CHAINS_BITS obviously causes BUILD_BUG. '*5' is more than 2 bits shift, so CONFIG_LOCKDEP_CHAINS_BITS has to be less than (24-2), limited to the range 10--21. Hmm, I tried. CONFIG_LOCKDEP_BITS=30 CONFIG_LOCKDEP_CHAINS_BITS=21 CONFIG_LOCKDEP_STACK_TRACE_BITS=30 CONFIG_LOCKDEP_STACK_TRACE_HASH_BITS=30 CONFIG_LOCKDEP_CIRCULAR_QUEUE_BITS=30 Arg, LD failed. ld: kernel/locking/lockdep.o: in function `lockdep_hlock_class': lockdep.c:(.text+0x84f): relocation truncated to fit: R_X86_64_PC32 against `.bss' I am afraid these LOCKDEP configurations need some sort of balancing. J. R. Okajima