Re: [PATCH] workqueue: Fix false leak report when lockdep is turned off
From: Tejun Heo
Date: Thu Dec 03 2026 - 14:47:20 EST
Applied to wq/for-7.5 with the following change:
- READ_ONCE() is used for the lockless debug_locks test.
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3511,7 +3511,7 @@ __acquires(&pool->lock)
if (unlikely((worker->task && in_atomic()) ||
(lockdep_depth(current) != lockdep_start_depth &&
- debug_locks) ||
+ READ_ONCE(debug_locks)) ||
rcu_preempt_depth() != rcu_start_depth)) {
pr_err("BUG: workqueue leaked atomic, lock or RCU: %s[%d]\n"
" preempt=0x%08x lock=%d->%d RCU=%d->%d workfn=%ps\n",
Thanks.
--
tejun