]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
workqueue: replace BUG_ON with panic in panic_on_wq_watchdog
authorBreno Leitao <leitao@debian.org>
Fri, 6 Feb 2026 11:18:02 +0000 (03:18 -0800)
committerTejun Heo <tj@kernel.org>
Sat, 7 Feb 2026 16:54:42 +0000 (06:54 -1000)
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>
kernel/workqueue.c

index 68e664d7dbecf39489fd8ca6cc3acf398b11846f..e6c249f2fb46b1f8a1fc8121310123a7fe01e8bb 100644 (file)
@@ -7637,10 +7637,14 @@ static void panic_on_wq_watchdog(unsigned int stall_time_sec)
 
        if (wq_panic_on_stall) {
                wq_stall++;
-               BUG_ON(wq_stall >= wq_panic_on_stall);
+               if (wq_stall >= wq_panic_on_stall)
+                       panic("workqueue: %u stall(s) exceeded threshold %u\n",
+                             wq_stall, wq_panic_on_stall);
        }
 
-       BUG_ON(wq_panic_on_stall_time && stall_time_sec >= wq_panic_on_stall_time);
+       if (wq_panic_on_stall_time && stall_time_sec >= wq_panic_on_stall_time)
+               panic("workqueue: stall lasted %us, exceeding threshold %us\n",
+                     stall_time_sec, wq_panic_on_stall_time);
 }
 
 static void wq_watchdog_reset_touched(void)