Skip to content

Commit 9cb8b0f

Browse files
leitaohtejun
authored andcommitted
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 <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent f84c9dd commit 9cb8b0f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

kernel/workqueue.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7637,10 +7637,14 @@ static void panic_on_wq_watchdog(unsigned int stall_time_sec)
76377637

76387638
if (wq_panic_on_stall) {
76397639
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);
76417643
}
76427644

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);
76447648
}
76457649

76467650
static void wq_watchdog_reset_touched(void)

0 commit comments

Comments
 (0)