]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
workqueue: Remove redundant rcu_read_lock/unlock() in workqueue_congested()
authorZqiang <qiang.zhang@linux.dev>
Thu, 4 Sep 2025 11:31:32 +0000 (19:31 +0800)
committerTejun Heo <tj@kernel.org>
Thu, 4 Sep 2025 16:17:52 +0000 (06:17 -1000)
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>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c

index c6b79b3675c314368476ca188cf09ac53a4f331b..831754e900714d7db2f537d27128f2ea0693648e 100644 (file)
@@ -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;
 }