From nobody Fri Dec 19 17:38:09 2025 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17F4F79FE for ; Tue, 6 Aug 2024 01:01:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722906099; cv=none; b=XCvOinZlIKX7iKrBRtBQCUdkIXkQVPhlZyGuSwAEvcyAThNjIJlsw7AtVTX0yqs81Z0n9w6dE+C29nil00ZfWOlWaM4BMNnExxsAFnRXkoX/t3tu/CAT+bnitSmwCWA8Slb7WHgJAjn+Cyd1s9lkRaIarGPzS/EiJgZ/Nzjq4E0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722906099; c=relaxed/simple; bh=lEREMC8nwP8bMnwwRi/0BYTwDxD2mNtJ6dPerEYrHpY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=RRFj48bT3wG9Pg9DnZMy4TPKXiRB5TcTlcD821YhomDZyOrNcdhtrvRNwPDNzbEZZ772gDc0WASqh8MwfpVE6dEK5XKiB9/hSi3gvgBtRvOBe3jnfvYHevcXBJe4Tg7A3qeaLupBiomrzG/Lp+3FE6SZv3Gb7Wih1HNgbDaDqhI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--cmllamas.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=G5xeQqYn; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--cmllamas.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="G5xeQqYn" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2cb6b642c49so6285047a91.1 for ; Mon, 05 Aug 2024 18:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1722906097; x=1723510897; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=REuCo1faqXAX+8qIFuyehGQRyeUKRlEhQVu0+BMNAnU=; b=G5xeQqYnMlx5gFgRCPJSwdgc7CzX8tjKq81CzUX0lXBDysqwznEuD8kf/IA03OjtYc MadN+jJnwWGVHfw4zZ9h8/U2VGZ5/lcWVKlB7NmoM0+3D0JsaqIv0Ua234UeMUN68XKl jM6lkWy8syjWVuvqiZv0PCvDrTkqcasI+ZpNAEQurE1rZ6nU5HTpVN7hmuMCPgt61Fj6 mwk2wnSbO8uyrOzaseQHCKt/GjK3dFfqB9VIkbxP8p3JoE/p6zUOOK9PSa2W1zsRWq+y 86hK/IHzL7t8SAlNRylFqrPJ2bSu1BG5bSC9o3w/FLzPBpsyebfNsoXBaCxz3noBEOXk j5qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722906097; x=1723510897; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=REuCo1faqXAX+8qIFuyehGQRyeUKRlEhQVu0+BMNAnU=; b=ptl64rZvjkXBzJDxjv68k9KUjZ2psKCTl8o7zrTIB/4bnd6tpy2BHATk1CWz6e+qf8 PFY08uafNG04IsRdYc3KeNVDrFW92iaYopJMSH62PZBX1HPjsbhI5Vsn7KEC3o2H+eCX kBBX7bNhPgKEZxgrc7qjamBEKf3nwvyCMWposaq8S02GXVTPWo2fbrYWgFYl2Dh5gICf 5lUAxxTQHMIR8oUxXhULdIu5ELg5wFGwduzVua7SzQiXpYVzDY3tUA5T/W64d9PrnhW5 sH9XOcCZF2ELBTJoZEJ5TY/oiCiujTNrDpt7d4e0xd0W+z8NEZl5C06+/Wd3Jn0o2vKa CVaA== X-Gm-Message-State: AOJu0Yy9IUt3jyJPlZFDGs6TDaWjuSHL5hBvn7SnaUF+bhtu59kM8+zj IJql0xUpx+loiYmmwFvh7p1VZupM6fiAYIZk63JiGiCHFugwc3NBzgPCInpKqWKvMQ9hLW/681G WrMSAzUcx1w== X-Google-Smtp-Source: AGHT+IFmjCbQdd3T2JsDntUYDK5xEnBc8mVdC7metrm8H5PNsi/BrvxTz2dEN9ZEl7QAURhMlPxWajje6RFB8Q== X-Received: from xllamas.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5070]) (user=cmllamas job=sendgmr) by 2002:a17:90a:ca96:b0:2ca:f1a0:8e74 with SMTP id 98e67ed59e1d1-2cffa253021mr116330a91.2.1722906096969; Mon, 05 Aug 2024 18:01:36 -0700 (PDT) Date: Tue, 6 Aug 2024 01:01:24 +0000 In-Reply-To: <20240806010128.402852-1-cmllamas@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240806010128.402852-1-cmllamas@google.com> X-Mailer: git-send-email 2.46.0.rc2.264.g509ed76dc8-goog Message-ID: <20240806010128.402852-2-cmllamas@google.com> Subject: [PATCH 1/3] lockdep: fix upper limit for LOCKDEP_*_BITS configs From: Carlos Llamas To: Andrew Morton Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, Carlos Llamas , "J. R. Okajima" , Peter Zijlstra , Boqun Feng , Ingo Molnar , Waiman Long , Will Deacon Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Lockdep has a set of configs used to determine the size of the static arrays that it uses. However, the upper limit that was initially setup for these configs is too high (30 bit shift). This equates to several GiB of static memory for individual symbols. Using such high values leads to linker errors: $ make defconfig $ ./scripts/config -e PROVE_LOCKING --set-val LOCKDEP_BITS 30 $ make olddefconfig all [...] ld: kernel image bigger than KERNEL_IMAGE_SIZE ld: section .bss VMA wraps around address space Adjust the upper limits to the maximum values that avoid these issues. The need for anything more, likely points to a problem elsewhere. Note that LOCKDEP_CHAINS_BITS was intentionally left out as its upper limit had a different symptom and has already been fixed [1]. Reported-by: J. R. Okajima Closes: https://lore.kernel.org/all/30795.1620913191@jrobl/ [1] Cc: Peter Zijlstra Cc: Boqun Feng Cc: Ingo Molnar Cc: Waiman Long Cc: Will Deacon Signed-off-by: Carlos Llamas Acked-by: Waiman Long --- lib/Kconfig.debug | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index a81d452941ce..baaaedfde0cb 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1507,7 +1507,7 @@ config LOCKDEP_SMALL config LOCKDEP_BITS int "Bitsize for MAX_LOCKDEP_ENTRIES" depends on LOCKDEP && !LOCKDEP_SMALL - range 10 30 + range 10 24 default 15 help Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!= " message. @@ -1523,7 +1523,7 @@ config LOCKDEP_CHAINS_BITS config LOCKDEP_STACK_TRACE_BITS int "Bitsize for MAX_STACK_TRACE_ENTRIES" depends on LOCKDEP && !LOCKDEP_SMALL - range 10 30 + range 10 26 default 19 help Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too = low!" message. @@ -1531,7 +1531,7 @@ config LOCKDEP_STACK_TRACE_BITS config LOCKDEP_STACK_TRACE_HASH_BITS int "Bitsize for STACK_TRACE_HASH_SIZE" depends on LOCKDEP && !LOCKDEP_SMALL - range 10 30 + range 10 26 default 14 help Try increasing this value if you need large STACK_TRACE_HASH_SIZE. @@ -1539,7 +1539,7 @@ config LOCKDEP_STACK_TRACE_HASH_BITS config LOCKDEP_CIRCULAR_QUEUE_BITS int "Bitsize for elements in circular_queue struct" depends on LOCKDEP - range 10 30 + range 10 26 default 12 help Try increasing this value if you hit "lockdep bfs error:-1" warning due= to __cq_enqueue() failure. --=20 2.46.0.rc2.264.g509ed76dc8-goog From nobody Fri Dec 19 17:38:09 2025 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCFBDC2E9 for ; Tue, 6 Aug 2024 01:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722906102; cv=none; b=StDxStGOhN5T542tOZVevK30pIqYxPFINuKfdKpKX0QsRufKZ5alb+cSkrJYyBPYZgKFnuz7N5TYiUBXuIywpGbCdgbe1q3wnxF7pBgFkksKNa1Q6PBUQZ6laIq0BpuCO/8C0WDWUcVnz4QfsVW0rlkmjQJQLTYHxUBMhsHsxWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722906102; c=relaxed/simple; bh=WPQeRoVjbHyBaB1jP3uLP9qNWJc7u6TPtPAVY/T4QWc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=eJsGQIPYqpvhk+8FHbDrURYUDhRFRdFTmlRJ70NLD1CPlxl5p6jXF1+taO6LbUJtbOHrU/vRTEH/IR1ndHV9rNKIxMwtr3cw/h1zcspyjOkQfZcayNFje5wq4mQvRXMuUNljfbLJSkBlRQodEngvp6qAn++TWBK5kKhasy/OxU0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--cmllamas.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=bas5WlYw; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--cmllamas.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bas5WlYw" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1fd5fe96cfeso911275ad.0 for ; Mon, 05 Aug 2024 18:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1722906100; x=1723510900; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=xF7GVsamqUptJkU2gJsmYYeaq0bMeaFAbotmm0oMB2I=; b=bas5WlYwSx3r/AzHbVCktkFxnLFtVRa5+k9DsxE9hI3YkekosbG5ir2xgUjqdm3oFz 6O3HOBEcAqSZQLmsy3pEpc8kl+bkjlc+g2422zG8IdWgaK1vZeUolMpbuwfSYJTvrXHn CtyTTxuUYWdgxqjteesYBcDr2qdrxiRUEn1uDgi1DkgC/aE55p5dnQP5fIGhEF3cWoVJ gBCQLilbfBPWOvTFncIKz3IPicQyoRHk9FQfnvBCvyJXHPRwuNiDAKcNtow4w3Mbr8VK 3hpzR4FRgog0N0MogJBALDRccEq+uTIBZVxA6zvAnx8iAofRruVF93e3U+zpw4nEkHpT SGkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722906100; x=1723510900; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xF7GVsamqUptJkU2gJsmYYeaq0bMeaFAbotmm0oMB2I=; b=BKSXdsD/oBjrK7BujxviW5xGHU4ji3zWZLNKDhz+S/vQx+oqXjhO5MKaUA0IWoKGAz 24mXDlUST30m/nECODxerOQZG3a12tlMgolzI/ixngx1WEy47rwmxdELbN9Higgvwjm0 PBd2vNR5fc0JyRrf0InB6zEjlHL8Zu4arsIs8nP/COtag1Hj8kFOPxj5qSsCFhW1SHoT +z+A1AynAvYj+4LTZJOG+uReqcQ25nDpY2pdnCIFoCHimB3q66y25uToTxt4VadutMvO vYvCYCI10hPZC7cJO0h6KTXoidT5iI47j7TCkKtqEKHXIHHwvJ6nQ1KZ6unXivL8TMRq ISMQ== X-Gm-Message-State: AOJu0YwOA7QNaq+47EmdmX6KnKfsB2hYO5f0yez4vfvfdLoGggQffjJE ZF9gljGAww1Gb2da9IrWD7s2WZXnvdpGCcuddBnZI1R8qigD37UsSXxdDCJp+haSi8bd31azmP1 Enuf7gNf/eA== X-Google-Smtp-Source: AGHT+IHnnOp7s9VQJe4Mo68TMAH3l/gac5t/LGDPThZwtPKP9hYBQadcdWj9W6S329YgBaaQyXsGdj8sSjN0Xw== X-Received: from xllamas.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5070]) (user=cmllamas job=sendgmr) by 2002:a17:902:f54b:b0:1fe:1a92:5b2 with SMTP id d9443c01a7336-1ff57254d7fmr14295605ad.1.1722906099686; Mon, 05 Aug 2024 18:01:39 -0700 (PDT) Date: Tue, 6 Aug 2024 01:01:25 +0000 In-Reply-To: <20240806010128.402852-1-cmllamas@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240806010128.402852-1-cmllamas@google.com> X-Mailer: git-send-email 2.46.0.rc2.264.g509ed76dc8-goog Message-ID: <20240806010128.402852-3-cmllamas@google.com> Subject: [PATCH 2/3] lockdep: clarify size for LOCKDEP_*_BITS configs From: Carlos Llamas To: Andrew Morton Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, Carlos Llamas , Peter Zijlstra , Boqun Feng , Ingo Molnar , Waiman Long , Will Deacon Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The LOCKDEP_*_BITS configs control the size of internal structures used by lockdep. The size is calculated as a power of two of the configured value (e.g. 16 =3D> 64KB). Update these descriptions to more accurately reflect this, as "Bitsize" can be misleading. Suggested-by: Andrew Morton Cc: Peter Zijlstra Cc: Boqun Feng Cc: Ingo Molnar Cc: Waiman Long Cc: Will Deacon Signed-off-by: Carlos Llamas --- lib/Kconfig.debug | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index baaaedfde0cb..e0614a415348 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1505,7 +1505,7 @@ config LOCKDEP_SMALL bool =20 config LOCKDEP_BITS - int "Bitsize for MAX_LOCKDEP_ENTRIES" + int "Size for MAX_LOCKDEP_ENTRIES (as Nth power of 2)" depends on LOCKDEP && !LOCKDEP_SMALL range 10 24 default 15 @@ -1513,7 +1513,7 @@ config LOCKDEP_BITS Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!= " message. =20 config LOCKDEP_CHAINS_BITS - int "Bitsize for MAX_LOCKDEP_CHAINS" + int "Size for MAX_LOCKDEP_CHAINS (as Nth power of 2)" depends on LOCKDEP && !LOCKDEP_SMALL range 10 21 default 16 @@ -1521,7 +1521,7 @@ config LOCKDEP_CHAINS_BITS Try increasing this value if you hit "BUG: MAX_LOCKDEP_CHAINS too low!"= message. =20 config LOCKDEP_STACK_TRACE_BITS - int "Bitsize for MAX_STACK_TRACE_ENTRIES" + int "Size for MAX_STACK_TRACE_ENTRIES (as Nth power of 2)" depends on LOCKDEP && !LOCKDEP_SMALL range 10 26 default 19 @@ -1529,7 +1529,7 @@ config LOCKDEP_STACK_TRACE_BITS Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too = low!" message. =20 config LOCKDEP_STACK_TRACE_HASH_BITS - int "Bitsize for STACK_TRACE_HASH_SIZE" + int "Size for STACK_TRACE_HASH_SIZE (as Nth power of 2)" depends on LOCKDEP && !LOCKDEP_SMALL range 10 26 default 14 @@ -1537,7 +1537,7 @@ config LOCKDEP_STACK_TRACE_HASH_BITS Try increasing this value if you need large STACK_TRACE_HASH_SIZE. =20 config LOCKDEP_CIRCULAR_QUEUE_BITS - int "Bitsize for elements in circular_queue struct" + int "Size for elements in circular_queue struct (as Nth power of 2)" depends on LOCKDEP range 10 26 default 12 --=20 2.46.0.rc2.264.g509ed76dc8-goog From nobody Fri Dec 19 17:38:09 2025 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DAEF1799B for ; Tue, 6 Aug 2024 01:01:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722906104; cv=none; b=EPOMnkqF45yrZNQpRwNkU+G+OFrRzMG3JqskdR5VN5BR3fsUFG1nuO/ywUWJJsScLatHXjkGdrG8vLm6LWjhcwy7INk5mcMDJuczy2NWGJ4kBjXnxOejFE1L6I7QUGFt3ybSQlCq9Nt9vxXK7N1h2R3bXNY+KAKSPhVM5On3Ka0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722906104; c=relaxed/simple; bh=Km+iJPKlLRg1mRcLnrAduu/BuUz0nmCQY6HrdWcZR0I=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=oMYSwOayuaoiawu9weDldUzkMhW9JO+UNpp9vDbXAz57Z+MULfl7WkME+ilqkfksV+BGMNpm+gCOl30r0wefNsGHmJ6RRG7cd5BzyijTuOjPPNG2JoHWbZTKoGLVT7krjP1+kyf3RpmTMtODWtAtwMl7ZY8RvAoZ9cJCMlbu+ww= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--cmllamas.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ka/YApqs; arc=none smtp.client-ip=209.85.215.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--cmllamas.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ka/YApqs" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-7a1914d0936so118620a12.3 for ; Mon, 05 Aug 2024 18:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1722906103; x=1723510903; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=IMpFhIDOals2MKSWZWMbH7rS8dQ/Ls9OxICKkzOKh+0=; b=ka/YApqsjcAMBwZVUYS4X1m1pYS96OywsJOZnPtr1q2eeDy6D+IBKrjcZ8JWO96qZa S5nQSETRn7uWL1L1IQTc2RSKx2xNGh3wUM9d3KUwA5EDj0hJpU++dXBchEYgXEYxiQKx u+j6PTq6Dl5vZjYYSWqUO3YIPdyVSL+z78+xMk/VWyqZIhUvhn/HXcww7PrfwLEKAdZs pPc2wDbMR7DrViiS0KiUMr0SCh7AxJHLBrec4K5Ne8yS45783EZH/HR8w6XM7Fz7W9TJ LRFVCtoqgvTEdUgrL0VCghB1fpNk1yzEhSgsidZ+6MD14DQ8kmXj5lBGYjfkLCNcnKFk 8V1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722906103; x=1723510903; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IMpFhIDOals2MKSWZWMbH7rS8dQ/Ls9OxICKkzOKh+0=; b=R99CK5IYgu9KeidjFjTzCXPRtxBydqJR6NPZsXDJHleOiNy4/jzf9ndhi55VZ4doua go7jrbs+mnVLDK9Nk1iPFaDvge1jfyRWx/wZdnNzHJnh32GyerH4yEAZO+BIa1VSaUB2 DiulOtgdRdtLX823j54+nq+T6QdwxA6w7ZB/cYaR2stYZBlVfF0qhRh2OiUjgXnkZsSv kc9ShNTezLR8ZpNXGJ9zCMyh/fIqfAOWuO4IIjeC7lNFBnj2wrE050zZsex62QP83MmR D7T+ZnYuxZVrTK3fSZsIbtoOyscNpuuxo+rTseQtOTKrr5vfcWoiryYq6Tbllkm20OdQ 66Kg== X-Gm-Message-State: AOJu0Ywnc+YDCL1IK88hvj/0lPw8uaAJbdvh5rzsXFAfklXMG5ByrCTK GDWQ+DYvN/b/eqxohWAWZ3PIMyXXVc5j37TwY9UN4PeQgdqqPse46uspJlWY4+uHChij05pv+bt EXzaXZYrZKg== X-Google-Smtp-Source: AGHT+IHCkb1x+tcC8Zl5405hmEgWnQ5SRcEcP4wmpsZR9KLu0wxUs9mbgmT06I15SruC2BaSkbklt5uL6m1hag== X-Received: from xllamas.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5070]) (user=cmllamas job=sendgmr) by 2002:a65:6886:0:b0:7a1:f561:8c99 with SMTP id 41be03b00d2f7-7b74893b228mr27035a12.6.1722906102329; Mon, 05 Aug 2024 18:01:42 -0700 (PDT) Date: Tue, 6 Aug 2024 01:01:26 +0000 In-Reply-To: <20240806010128.402852-1-cmllamas@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240806010128.402852-1-cmllamas@google.com> X-Mailer: git-send-email 2.46.0.rc2.264.g509ed76dc8-goog Message-ID: <20240806010128.402852-4-cmllamas@google.com> Subject: [PATCH 3/3] lockdep: document MAX_LOCKDEP_CHAIN_HLOCKS calculation From: Carlos Llamas To: Peter Zijlstra , Ingo Molnar , Will Deacon Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, Carlos Llamas , Huang Ying , "J. R. Okajima" , Boqun Feng , Waiman Long Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a comment to document the magic number '5' used in the calculation of MAX_LOCKDEP_CHAIN_HLOCKS. This number represents the estimated average depth (number of locks held) of a lock chain. This definition was added in commit 443cd507ce7f ("lockdep: add lock_class information to lock_chain and output it"). Cc: Huang Ying Cc: J. R. Okajima Cc: Peter Zijlstra Cc: Boqun Feng Cc: Ingo Molnar Cc: Waiman Long Cc: Will Deacon Signed-off-by: Carlos Llamas --- kernel/locking/lockdep_internals.h | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/locking/lockdep_internals.h b/kernel/locking/lockdep_in= ternals.h index bbe9000260d0..2b429ed103a8 100644 --- a/kernel/locking/lockdep_internals.h +++ b/kernel/locking/lockdep_internals.h @@ -119,6 +119,7 @@ static const unsigned long LOCKF_USED_IN_IRQ_READ =3D =20 #define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS) =20 +/* We estimate that a chain holds 5 locks on average. */ #define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5) =20 extern struct lock_chain lock_chains[]; --=20 2.46.0.rc2.264.g509ed76dc8-goog