]> xenbits.xensource.com Git - people/jgross/linux.git/commitdiff
locking/csd_lock: Add Kconfig option for csd_debug default
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 21 Mar 2023 00:55:13 +0000 (17:55 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 24 Mar 2023 10:01:25 +0000 (11:01 +0100)
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
Documentation/admin-guide/kernel-parameters.txt
kernel/smp.c
lib/Kconfig.debug

index 6221a1d057dd58de265283de65e785c618ea6758..ce70777f59996d39c3e77ddce5e4b4aa3bce071b 100644 (file)
                        handling. When switched on, additional debug data is
                        printed to the console in case a hanging CPU is
                        detected, and that CPU is pinged again in order to try
-                       to resolve the hang situation.
-                       0: disable csdlock debugging (default)
+                       to resolve the hang situation.  The default value of
+                       this option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
+                       Kconfig option.
+                       0: disable csdlock debugging
                        1: enable basic csdlock debugging (minor impact)
                        ext: enable extended csdlock debugging (more impact,
                             but more data)
index 06a413987a14acbdcccdc6f4e29b104770f2241a..e2d558f5cef8a180cffcc07859f4960d18ca0b63 100644 (file)
@@ -158,7 +158,7 @@ void __init call_function_init(void)
 
 #ifdef CONFIG_CSD_LOCK_WAIT_DEBUG
 
-static DEFINE_STATIC_KEY_FALSE(csdlock_debug_enabled);
+static DEFINE_STATIC_KEY_MAYBE(CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT, csdlock_debug_enabled);
 static DEFINE_STATIC_KEY_FALSE(csdlock_debug_extended);
 
 static int __init csdlock_debug(char *str)
index c8b379e2e9adc14f0a79dbb2b97497a356a2c6e5..e1b160a0474db650f9f78a4e1801d90f0da8733b 100644 (file)
@@ -1480,6 +1480,15 @@ config CSD_LOCK_WAIT_DEBUG
          include the IPI handler function currently executing (if any)
          and relevant stack traces.
 
+config CSD_LOCK_WAIT_DEBUG_DEFAULT
+       bool "Default csd_lock_wait() debugging on at boot time"
+       depends on CSD_LOCK_WAIT_DEBUG
+       depends on 64BIT
+       default n
+       help
+         This option causes the csdlock_debug= kernel boot parameter to
+         default to 1 (basic debugging) instead of 0 (no debugging).
+
 endmenu # lock debugging
 
 config TRACE_IRQFLAGS