From: Kunwu Chan <kunwu.chan@gmail.com>
To: tj@kernel.org, jiangshanlai@gmail.com
Cc: linux-kernel@vger.kernel.org, Kunwu Chan <kunwu.chan@gmail.com>
Subject: [PATCH] workqueue: Drop redundant rcu_read_lock() from dump functions
Date: Sun, 20 Sep 2026 10:45:50 +0800 [thread overview]
Message-ID: <20260920024550.2278408-1-kunwu.chan@gmail.com> (raw)
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
next reply other threads:[~2026-09-20 2:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 2:45 Kunwu Chan [this message]
2026-09-20 3:08 ` Lai Jiangshan
2026-09-20 3:49 ` KunWu Chan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260920024550.2278408-1-kunwu.chan@gmail.com \
--to=kunwu.chan@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®