[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1503512338-25312-1-git-send-email-longman@redhat.com>
Date: Wed, 23 Aug 2017 14:18:58 -0400
From: Waiman Long <longman@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>
Cc: linux-kernel@...r.kernel.org, Waiman Long <longman@...hat.com>
Subject: [PATCH] locking/lockdep: Make MAX_STACK_TRACE_ENTRIES configurable
A "BUG: MAX_STACK_TRACE_ENTRIES too low!" error was hit when running a
networking test on a 4.11 kernel. So even 512k of stack trace entries
wasn't enough in this case.
Instead of hardcoding a larger MAX_STACK_TRACE_ENTRIES value,
it is now made to be dependent on a new kernel configuration entry
LOCKDEP_MAX_STACK_TRACE_ENTRIES so that kernel builders can configure
a proper value depending on how the kernel is being used.
The default for this new config option is the same as the current
value - 256k if LOCKDEP_SMALL and 512k otherwise.
Signed-off-by: Waiman Long <longman@...hat.com>
---
kernel/locking/lockdep_internals.h | 6 ++++++
lib/Kconfig.debug | 12 ++++++++++++
2 files changed, 18 insertions(+)
diff --git a/kernel/locking/lockdep_internals.h b/kernel/locking/lockdep_internals.h
index 1da4669..0873e9b 100644
--- a/kernel/locking/lockdep_internals.h
+++ b/kernel/locking/lockdep_internals.h
@@ -77,6 +77,12 @@ enum {
#define MAX_STACK_TRACE_ENTRIES 524288UL
#endif
+#ifdef CONFIG_LOCKDEP_MAX_STACK_TRACE_ENTRIES
+#undef MAX_STACK_TRACE_ENTRIES
+#define MAX_STACK_TRACE_ENTRIES \
+ ((unsigned long)CONFIG_LOCKDEP_MAX_STACK_TRACE_ENTRIES)
+#endif
+
#define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS)
#define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5)
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index ee9e534..0e8fc4e 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1230,6 +1230,18 @@ config WW_MUTEX_SELFTEST
Say M if you want these self tests to build as a module.
Say N if you are unsure.
+# Allow 256k - 4M of lockdep stack trace entries
+config LOCKDEP_MAX_STACK_TRACE_ENTRIES
+ int "Maximum number of lockdep stack trace entries" if LOCKDEP
+ range 262144 4194304
+ default "262144" if LOCKDEP_SMALL
+ default "524288" if !LOCKDEP_SMALL
+ ---help---
+ This specifies the maximum number of lockdep stack trace
+ entries that can be used by the locking correctness
+ validator. If this limit is exceeded, the validator will
+ be turned off.
+
endmenu # lock debugging
config TRACE_IRQFLAGS
--
1.8.3.1
Powered by blists - more mailing lists