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.

workqueue: add CONFIG_BOOTPARAM_WQ_STALL_PANIC option

Add a kernel config option to set the default value of
workqueue.panic_on_stall, similar to CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC,
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC and CONFIG_BOOTPARAM_HUNG_TASK_PANIC.

This allows setting the number of workqueue stalls before triggering
a kernel panic at build time, which is useful for high-availability
systems that need consistent panic-on-stall, in other words, those
servers which run with CONFIG_BOOTPARAM_*_PANIC=y already.

The default remains 0 (disabled). Setting it to 1 will panic on the
first stall, and higher values will panic after that many stall
warnings. The value can still be overridden at runtime via the
workqueue.panic_on_stall boot parameter or sysfs.

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Breno Leitao and committed by
Tejun Heo
32d572e3 51cd2d2d

+26 -2
+2 -1
Documentation/admin-guide/kernel-parameters.txt
··· 8336 8336 CONFIG_WQ_WATCHDOG. It sets the number times of the 8337 8337 stall to trigger panic. 8338 8338 8339 - The default is 0, which disables the panic on stall. 8339 + The default is set by CONFIG_BOOTPARAM_WQ_STALL_PANIC, 8340 + which is 0 (disabled) if not configured. 8340 8341 8341 8342 workqueue.cpu_intensive_thresh_us= 8342 8343 Per-cpu work items which run for longer than this
+1 -1
kernel/workqueue.c
··· 7568 7568 static unsigned long wq_watchdog_touched = INITIAL_JIFFIES; 7569 7569 static DEFINE_PER_CPU(unsigned long, wq_watchdog_touched_cpu) = INITIAL_JIFFIES; 7570 7570 7571 - static unsigned int wq_panic_on_stall; 7571 + static unsigned int wq_panic_on_stall = CONFIG_BOOTPARAM_WQ_STALL_PANIC; 7572 7572 module_param_named(panic_on_stall, wq_panic_on_stall, uint, 0644); 7573 7573 7574 7574 /*
+23
lib/Kconfig.debug
··· 1297 1297 state. This can be configured through kernel parameter 1298 1298 "workqueue.watchdog_thresh" and its sysfs counterpart. 1299 1299 1300 + config BOOTPARAM_WQ_STALL_PANIC 1301 + int "Panic on Nth workqueue stall" 1302 + default 0 1303 + range 0 100 1304 + depends on WQ_WATCHDOG 1305 + help 1306 + Set the number of workqueue stalls to trigger a kernel panic. 1307 + A workqueue stall occurs when a worker pool doesn't make forward 1308 + progress on a pending work item for over 30 seconds (configurable 1309 + using the workqueue.watchdog_thresh parameter). 1310 + 1311 + If n = 0, the kernel will not panic on stall. If n > 0, the kernel 1312 + will panic after n stall warnings. 1313 + 1314 + The panic can be used in combination with panic_timeout, 1315 + to cause the system to reboot automatically after a 1316 + stall has been detected. This feature is useful for 1317 + high-availability systems that have uptime guarantees and 1318 + where a stall must be resolved ASAP. 1319 + 1320 + This setting can be overridden at runtime via the 1321 + workqueue.panic_on_stall kernel parameter. 1322 + 1300 1323 config WQ_CPU_INTENSIVE_REPORT 1301 1324 bool "Report per-cpu work items which hog CPU for too long" 1302 1325 depends on DEBUG_KERNEL