[PATCH] workqueue: Drop redundant rcu_read_lock() from dump functions

From: Kunwu Chan

Date: Sat Sep 19 2026 - 22:46:12 EST


show_all_workqueues() and show_cpu_pools_busy_workers() are called
from contexts that already provide RCU read-side protection.

show_all_workqueues() is called from wq_watchdog_timer_fn(), which
runs in softirq context, and from sysrq_handle_showstate() through
__handle_sysrq(), which holds rcu_read_lock().

show_cpu_pools_busy_workers() is called from wq_watchdog_timer_fn()
as well.

Drop the redundant RCU read-side locking from both functions.

Signed-off-by: Kunwu Chan <kunwu.chan@xxxxxxxxx>
---
kernel/workqueue.c | 8 --------
1 file changed, 8 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 3c034cbc5bb3..266c3549df0f 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -6711,8 +6711,6 @@ void show_all_workqueues(void)
struct worker_pool *pool;
int pi;

- rcu_read_lock();
-
pr_info("Showing busy workqueues and worker pools:\n");

list_for_each_entry_rcu(wq, &workqueues, list)
@@ -6720,8 +6718,6 @@ void show_all_workqueues(void)

for_each_pool(pool, pi)
show_one_worker_pool(pool);
-
- rcu_read_unlock();
}

/**
@@ -7883,15 +7879,11 @@ static void show_cpu_pools_busy_workers(void)

pr_info("Showing backtraces of busy workers in stalled worker pools:\n");

- rcu_read_lock();
-
for_each_pool(pool, pi) {
if (pool->cpu_stall)
show_cpu_pool_busy_workers(pool);

}
-
- rcu_read_unlock();
}

/*
--
2.43.0