Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rcu: Add BOOTPARAM_RCU_STALL_PANIC Kconfig option

Add a Kconfig option to set the default value of the
kernel.panic_on_rcu_stall sysctl, allowing the kernel to be built
with panic-on-RCU-stall enabled by default.

This is useful for high-availability systems that require automatic
recovery (via panic_timeout) when a CPU stall is detected, without
needing userspace to configure the sysctl at boot.

This follows the pattern established by BOOTPARAM_SOFTLOCKUP_PANIC
and BOOTPARAM_HUNG_TASK_PANIC. The runtime sysctl can still override
the Kconfig default.

Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Gustavo Luiz Duarte <gustavold@gmail.com>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>

authored by

Gustavo Luiz Duarte and committed by
Joel Fernandes
ab875b3e a1839621

+25 -1
+24
kernel/rcu/Kconfig.debug
··· 175 175 Say Y here if you want RCU CPU stall notifiers (you don't want them) 176 176 Say N if you are unsure. 177 177 178 + config BOOTPARAM_RCU_STALL_PANIC 179 + bool "Panic (reboot) on RCU CPU stall" 180 + depends on RCU_STALL_COMMON 181 + default n 182 + help 183 + Say Y here to enable the kernel to panic when an RCU CPU stall 184 + is detected. 185 + 186 + The panic can be used in combination with panic_timeout, 187 + to cause the system to reboot automatically after an 188 + RCU CPU stall has been detected. This feature is useful for 189 + high-availability systems that have uptime guarantees and 190 + where a CPU stall must be resolved ASAP. 191 + 192 + The kernel.max_rcu_stall_to_panic sysctl can be used to set 193 + a minimum number of stalls before panicking, allowing the 194 + system to tolerate a given number of RCU CPU stalls before 195 + triggering a panic. 196 + 197 + This setting can be overridden at runtime via the 198 + kernel.panic_on_rcu_stall sysctl parameter. 199 + 200 + Say N if unsure. 201 + 178 202 config RCU_TRACE 179 203 bool "Enable tracing for RCU" 180 204 depends on DEBUG_KERNEL
+1 -1
kernel/rcu/tree_stall.h
··· 17 17 // Controlling CPU stall warnings, including delay calculation. 18 18 19 19 /* panic() on RCU Stall sysctl. */ 20 - static int sysctl_panic_on_rcu_stall __read_mostly; 20 + static int sysctl_panic_on_rcu_stall __read_mostly = IS_ENABLED(CONFIG_BOOTPARAM_RCU_STALL_PANIC); 21 21 static int sysctl_max_rcu_stall_to_panic __read_mostly; 22 22 23 23 static const struct ctl_table rcu_stall_sysctl_table[] = {