lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240806010128.402852-4-cmllamas@google.com>
Date: Tue,  6 Aug 2024 01:01:26 +0000
From: Carlos Llamas <cmllamas@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>, 
	Will Deacon <will@...nel.org>
Cc: linux-kernel@...r.kernel.org, kernel-team@...roid.com, 
	Carlos Llamas <cmllamas@...gle.com>, Huang Ying <ying.huang@...el.com>, 
	"J. R. Okajima" <hooanon05g@...il.com>, Boqun Feng <boqun.feng@...il.com>, 
	Waiman Long <longman@...hat.com>
Subject: [PATCH 3/3] lockdep: document MAX_LOCKDEP_CHAIN_HLOCKS calculation

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 <ying.huang@...el.com>
Cc: J. R. Okajima <hooanon05g@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Boqun Feng <boqun.feng@...il.com>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Waiman Long <longman@...hat.com>
Cc: Will Deacon <will@...nel.org>
Signed-off-by: Carlos Llamas <cmllamas@...gle.com>
---
 kernel/locking/lockdep_internals.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/locking/lockdep_internals.h b/kernel/locking/lockdep_internals.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 =
 
 #define MAX_LOCKDEP_CHAINS	(1UL << MAX_LOCKDEP_CHAINS_BITS)
 
+/* We estimate that a chain holds 5 locks on average. */
 #define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5)
 
 extern struct lock_chain lock_chains[];
-- 
2.46.0.rc2.264.g509ed76dc8-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ