The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] workqueue: Remove redundant rcu_read_lock/unlock() in workqueue_congested()
@ 2025-09-04 11:31 Zqiang
  2025-09-04 11:31 ` [PATCH] workqueue: Remove rcu_read_lock/unlock() in wq_watchdog_timer_fn() Zqiang
  2025-09-04 16:18 ` [PATCH] workqueue: Remove redundant rcu_read_lock/unlock() in workqueue_congested() Tejun Heo
  0 siblings, 2 replies; 4+ messages in thread
From: Zqiang @ 2025-09-04 11:31 UTC (permalink / raw)
  To: tj, jiangshanlai; +Cc: linux-kernel, qiang.zhang

The preempt_disable/enable() has already formed RCU read crtical
section, this commit therefore remove rcu_read_lock/unlock() in
workqueue_congested().

Signed-off-by: Zqiang <qiang.zhang@linux.dev>
---
 kernel/workqueue.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index c6b79b3675c3..831754e90071 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -6046,7 +6046,6 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq)
 	struct pool_workqueue *pwq;
 	bool ret;
 
-	rcu_read_lock();
 	preempt_disable();
 
 	if (cpu == WORK_CPU_UNBOUND)
@@ -6056,7 +6055,6 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq)
 	ret = !list_empty(&pwq->inactive_works);
 
 	preempt_enable();
-	rcu_read_unlock();
 
 	return ret;
 }
-- 
2.17.1


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

end of thread, other threads:[~2025-09-04 16:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-04 11:31 [PATCH] workqueue: Remove redundant rcu_read_lock/unlock() in workqueue_congested() Zqiang
2025-09-04 11:31 ` [PATCH] workqueue: Remove rcu_read_lock/unlock() in wq_watchdog_timer_fn() Zqiang
2025-09-04 16:18   ` Tejun Heo
2025-09-04 16:18 ` [PATCH] workqueue: Remove redundant rcu_read_lock/unlock() in workqueue_congested() Tejun Heo

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