mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] workqueue: Drop redundant rcu_read_lock() from dump functions
@ 2026-09-20  2:45 Kunwu Chan
  2026-09-20  3:08 ` Lai Jiangshan
  0 siblings, 1 reply; 3+ messages in thread
From: Kunwu Chan @ 2026-09-20  2:45 UTC (permalink / raw)
  To: tj, jiangshanlai; +Cc: linux-kernel, Kunwu Chan

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@gmail.com>
---
 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-20  3:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-20  2:45 [PATCH] workqueue: Drop redundant rcu_read_lock() from dump functions Kunwu Chan
2026-09-20  3:08 ` Lai Jiangshan
2026-09-20  3:49   ` KunWu Chan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®