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: <173506642386.399.10857863846814476355.tip-bot2@tip-bot2>
Date: Tue, 24 Dec 2024 18:53:43 -0000
From: "tip-bot2 for Carlos Llamas" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Waiman Long <longman@...hat.com>, Huang Ying <ying.huang@...el.com>,
 "J. R. Okajima" <hooanon05g@...il.com>, Peter Zijlstra <peterz@...radead.org>,
 Boqun Feng <boqun.feng@...il.com>, Ingo Molnar <mingo@...hat.com>,
 Will Deacon <will@...nel.org>, Carlos Llamas <cmllamas@...gle.com>,
 x86@...nel.org, linux-kernel@...r.kernel.org
Subject:
 [tip: locking/core] lockdep: Document MAX_LOCKDEP_CHAIN_HLOCKS calculation

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     bd7b5ae26618ad2bd6f6264e2cb6c5815d323e75
Gitweb:        https://git.kernel.org/tip/bd7b5ae26618ad2bd6f6264e2cb6c5815d323e75
Author:        Carlos Llamas <cmllamas@...gle.com>
AuthorDate:    Thu, 24 Oct 2024 18:36:28 
Committer:     Boqun Feng <boqun.feng@...il.com>
CommitterDate: Sun, 15 Dec 2024 11:49:35 -08:00

lockdep: Document MAX_LOCKDEP_CHAIN_HLOCKS calculation

Define a macro AVG_LOCKDEP_CHAIN_DEPTH to document the magic number '5'
used in the calculation of MAX_LOCKDEP_CHAIN_HLOCKS. The number
represents the estimated average depth (number of locks held) of a lock
chain. The calculation of MAX_LOCKDEP_CHAIN_HLOCKS was first added in
commit 443cd507ce7f ("lockdep: add lock_class information to lock_chain
and output it").

Suggested-by: Waiman Long <longman@...hat.com>
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: Will Deacon <will@...nel.org>
Acked-by: Waiman Long <longman@...hat.com>
Signed-off-by: Carlos Llamas <cmllamas@...gle.com>
Acked-by: "Huang, Ying" <ying.huang@...el.com>
Signed-off-by: Boqun Feng <boqun.feng@...il.com>
Link: https://lore.kernel.org/r/20241024183631.643450-4-cmllamas@google.com
---
 kernel/locking/lockdep_internals.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/locking/lockdep_internals.h b/kernel/locking/lockdep_internals.h
index bbe9000..20f9ef5 100644
--- a/kernel/locking/lockdep_internals.h
+++ b/kernel/locking/lockdep_internals.h
@@ -119,7 +119,8 @@ static const unsigned long LOCKF_USED_IN_IRQ_READ =
 
 #define MAX_LOCKDEP_CHAINS	(1UL << MAX_LOCKDEP_CHAINS_BITS)
 
-#define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5)
+#define AVG_LOCKDEP_CHAIN_DEPTH		5
+#define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS * AVG_LOCKDEP_CHAIN_DEPTH)
 
 extern struct lock_chain lock_chains[];
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ