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: replace BUG_ON with panic in panic_on_wq_watchdog

Replace BUG_ON() with panic() in panic_on_wq_watchdog(). This is not
a bug condition but a deliberate forced panic requested by the user
via module parameters to crash the system for debugging purposes.

Using panic() instead of BUG_ON() makes this intent clearer and provides
more informative output about which threshold was exceeded and the actual
values, making it easier to diagnose the stall condition from crash dumps.

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
9cb8b0f2 f84c9dd3

+6 -2
+6 -2
kernel/workqueue.c
··· 7637 7637 7638 7638 if (wq_panic_on_stall) { 7639 7639 wq_stall++; 7640 - BUG_ON(wq_stall >= wq_panic_on_stall); 7640 + if (wq_stall >= wq_panic_on_stall) 7641 + panic("workqueue: %u stall(s) exceeded threshold %u\n", 7642 + wq_stall, wq_panic_on_stall); 7641 7643 } 7642 7644 7643 - BUG_ON(wq_panic_on_stall_time && stall_time_sec >= wq_panic_on_stall_time); 7645 + if (wq_panic_on_stall_time && stall_time_sec >= wq_panic_on_stall_time) 7646 + panic("workqueue: stall lasted %us, exceeding threshold %us\n", 7647 + stall_time_sec, wq_panic_on_stall_time); 7644 7648 } 7645 7649 7646 7650 static void wq_watchdog_reset_touched(void)