[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJhGHyDE18PwQtS_W-aZA4Z6SAX3ZiCr6bA1Gqpu=XMN2n724w@mail.gmail.com>
Date: Thu, 18 Feb 2021 11:04:00 +0800
From: Lai Jiangshan <jiangshanlai@...il.com>
To: "Zhang, Qiang" <qiang.zhang@...driver.com>
Cc: Tejun Heo <tj@...nel.org>, Tejun Heo <htejun@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
"Paul E. McKenney" <paulmck@...nel.org>
Subject: Re: [PATCH] workqueue: Remove rcu_read_lock/unlock() in workqueue_congested()
+CC Paul
On Wed, Feb 17, 2021 at 7:58 PM <qiang.zhang@...driver.com> wrote:
>
> From: Zqiang <qiang.zhang@...driver.com>
>
> The RCU read critical area already by preempt_disable/enable()
> (equivalent to rcu_read_lock_sched/unlock_sched()) mark, so remove
> rcu_read_lock/unlock().
I think we can leave it which acks like document, especially
workqueue_congested() is not performance crucial. Either way
is Ok for me.
If it needs to be changed, please also do the same for
rcu_read_lock() in wq_watchdog_timer_fn().
And __queue_work() and try_to_grab_pending() also use local_irq_save()
and rcu_read_lock() at the same time, but I don't know will these
local_irq_save() be changed to raw_local_irq_save() in PREEMPT_RT.
>
> Signed-off-by: Zqiang <qiang.zhang@...driver.com>
> ---
> kernel/workqueue.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index 0d150da252e8..c599835ad6c3 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -4540,7 +4540,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)
> @@ -4553,7 +4552,6 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq)
>
> ret = !list_empty(&pwq->delayed_works);
> preempt_enable();
> - rcu_read_unlock();
>
> return ret;
> }
> --
> 2.25.1
>
Powered by blists - more mailing lists