[PATCH 2/6: v4] lockdep: Make MAX_STACK_TRACE_ENTRIES configurable.

From: John Kacur
Date: Mon Jun 14 2010 - 18:22:49 EST


Certain debug configurations that have LOCKDEP turned on, run into the limit
where the MAX_STACK_TRACE_ENTRIES are too small. Rather than simply turning
off the locking correctness validator, let the user configure this value
to something reasonable for their system.

This patch was generated against 2.6.33.5-rt23 but is also intended to be
picked-up for mainline.

Message-ID: <alpine.LFD.2.00.1004161329030.11320@xxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>
---
kernel/lockdep_internals.h | 2 +-
lib/Kconfig.debug | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/kernel/lockdep_internals.h b/kernel/lockdep_internals.h
index a2ee95a..d0797bc 100644
--- a/kernel/lockdep_internals.h
+++ b/kernel/lockdep_internals.h
@@ -65,7 +65,7 @@ enum {
* Stack-trace: tightly packed array of stack backtrace
* addresses. Protected by the hash_lock.
*/
-#define MAX_STACK_TRACE_ENTRIES 262144UL
+#define MAX_STACK_TRACE_ENTRIES (CONFIG_MAX_STACK_ENTRIES_KIB*1024UL)

extern struct list_head all_lock_classes;
extern struct lock_chain lock_chains[];
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index cbf6e02..6087fb0 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -509,6 +509,16 @@ config LOCKDEP
select KALLSYMS
select KALLSYMS_ALL

+config MAX_STACK_ENTRIES_KIB
+ int "MAX_STACK_ENTRIES_KIB for LOCKDEP"
+ depends on LOCKDEP
+ default 256
+ help
+ This option allows you to change the default MAX_STACK_TRACE_ENTRIES
+ used by LOCKDEP. The default is 256*1024 = 262144.
+ Warning: increasing this will increase the size of stack_trace_array
+ and therefore the kernel size too.
+
config LOCK_STAT
bool "Lock usage statistics"
depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
--
1.6.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/