From: Ryan Huang <tzukui@google.com>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Waiman Long <longman@redhat.com>,
Boqun Feng <boqun.feng@gmail.com>,
Sasha Levin <sashal@kernel.org>
Cc: linux-kernel@vger.kernel.org, Ryan Huang <tzukui@google.com>
Subject: [PATCH] lockdep: Allow tuning tracing keys constant.
Date: Fri, 30 Sep 2022 10:00:58 -0700 [thread overview]
Message-ID: <20220930170058.2645213-1-tzukui@google.com> (raw)
Tetsuo Handa made a change for tuning lockdep tracing capacity constants
[1]. He created following tracing config constants:
- LOCKDEP_BITS
- LOCKDEP_CHAINS_BITS
- LOCKDEP_STACK_TRACE_BITS
However there is a missing one for LOCKDEP_KEYS_BITS. We can see this is
also hitting the upper limits in [2].
[1] https://github.com/torvalds/linux/commit/5dc33592e95534dc8455ce3e9baaaf3dae0fff82
[2] https://syzkaller.appspot.com/bug?id=df466e1151a7e45dd880d8c7033f1ad48acebfb4
Fixes: 5dc33592e955 ("lockdep: Allow tuning tracing capacity constants.")
Signed-off-by: Ryan Huang <tzukui@google.com>
---
include/linux/lockdep.h | 2 +-
lib/Kconfig.debug | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 1f1099dac3f05..3bb1740296559 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -82,7 +82,7 @@ struct lock_chain {
u64 chain_key;
};
-#define MAX_LOCKDEP_KEYS_BITS 13
+#define MAX_LOCKDEP_KEYS_BITS CONFIG_LOCKDEP_KEYS_BITS
#define MAX_LOCKDEP_KEYS (1UL << MAX_LOCKDEP_KEYS_BITS)
#define INITIAL_CHAIN_KEY -1
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index d3e5f36bb01e0..d15024bd14f1d 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1398,6 +1398,14 @@ config LOCKDEP_CHAINS_BITS
help
Try increasing this value if you hit "BUG: MAX_LOCKDEP_CHAINS too low!" message.
+config LOCKDEP_KEYS_BITS
+ int "Bitsize for MAX_LOCKDEP_KEYS"
+ depends on LOCKDEP && !LOCKDEP_SMALL
+ range 10 30
+ default 13
+ help
+ Try increasing this value if you hit "BUG: MAX_LOCKDEP_KEYS too low!" message.
+
config LOCKDEP_STACK_TRACE_BITS
int "Bitsize for MAX_STACK_TRACE_ENTRIES"
depends on LOCKDEP && !LOCKDEP_SMALL
--
2.38.0.rc1.362.ged0d419d3c-goog
next reply other threads:[~2022-09-30 17:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-30 17:00 Ryan Huang [this message]
2022-09-30 17:34 ` [PATCH] lockdep: Allow tuning tracing keys constant Waiman Long
2022-10-03 19:44 ` Sasha Levin
2022-10-27 20:18 ` Ryan Huang
2022-10-01 2:30 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220930170058.2645213-1-tzukui@google.com \
--to=tzukui@google.com \
--cc=boqun.feng@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=sashal@kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox