[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20260206-wqstall_panic_time-v1-2-f2a21d5d87a4@debian.org>
Date: Fri, 06 Feb 2026 03:18:02 -0800
From: Breno Leitao <leitao@...ian.org>
To: Tejun Heo <tj@...nel.org>, Lai Jiangshan <jiangshanlai@...il.com>
Cc: linux-kernel@...r.kernel.org, osandov@...ndov.com, rneu@...a.com,
Breno Leitao <leitao@...ian.org>, kernel-team@...a.com
Subject: [PATCH 2/2] 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@...ian.org>
---
kernel/workqueue.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 6f63899dd6317..754833b383fe9 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -7574,10 +7574,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)
--
2.47.3
Powered by blists - more mailing lists