Skip to content

Commit c521986

Browse files
paulmckrcuPeter Zijlstra
authored andcommitted
locking/csd_lock: Add Kconfig option for csd_debug default
The csd_debug kernel parameter works well, but is inconvenient in cases where it is more closely associated with boot loaders or automation than with a particular kernel version or release. Thererfore, provide a new CSD_LOCK_WAIT_DEBUG_DEFAULT Kconfig option that defaults csd_debug to 1 when selected and 0 otherwise, with this latter being the default. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Juergen Gross <jgross@suse.com> Link: https://lore.kernel.org/r/20230321005516.50558-1-paulmck@kernel.org
1 parent e8d018d commit c521986

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,10 @@
893893
handling. When switched on, additional debug data is
894894
printed to the console in case a hanging CPU is
895895
detected, and that CPU is pinged again in order to try
896-
to resolve the hang situation.
897-
0: disable csdlock debugging (default)
896+
to resolve the hang situation. The default value of
897+
this option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
898+
Kconfig option.
899+
0: disable csdlock debugging
898900
1: enable basic csdlock debugging (minor impact)
899901
ext: enable extended csdlock debugging (more impact,
900902
but more data)

kernel/smp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void __init call_function_init(void)
158158

159159
#ifdef CONFIG_CSD_LOCK_WAIT_DEBUG
160160

161-
static DEFINE_STATIC_KEY_FALSE(csdlock_debug_enabled);
161+
static DEFINE_STATIC_KEY_MAYBE(CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT, csdlock_debug_enabled);
162162
static DEFINE_STATIC_KEY_FALSE(csdlock_debug_extended);
163163

164164
static int __init csdlock_debug(char *str)

lib/Kconfig.debug

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,15 @@ config CSD_LOCK_WAIT_DEBUG
14801480
include the IPI handler function currently executing (if any)
14811481
and relevant stack traces.
14821482

1483+
config CSD_LOCK_WAIT_DEBUG_DEFAULT
1484+
bool "Default csd_lock_wait() debugging on at boot time"
1485+
depends on CSD_LOCK_WAIT_DEBUG
1486+
depends on 64BIT
1487+
default n
1488+
help
1489+
This option causes the csdlock_debug= kernel boot parameter to
1490+
default to 1 (basic debugging) instead of 0 (no debugging).
1491+
14831492
endmenu # lock debugging
14841493

14851494
config TRACE_IRQFLAGS

0 commit comments

Comments
 (0)