[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221024031540.GU5600@paulmck-ThinkPad-P17-Gen-1>
Date: Sun, 23 Oct 2022 20:15:40 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Joel Fernandes <joel@...lfernandes.org>
Cc: rcu@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-team@...com, rostedt@...dmis.org,
Uladzislau Rezki <urezki@...il.com>
Subject: Re: [PATCH rcu 13/14] workqueue: Make queue_rcu_work() use
call_rcu_flush()
On Sun, Oct 23, 2022 at 08:36:00PM -0400, Joel Fernandes wrote:
> Hello,
>
> On Wed, Oct 19, 2022 at 6:51 PM Paul E. McKenney <paulmck@...nel.org> wrote:
> >
> > From: Uladzislau Rezki <urezki@...il.com>
> >
> > call_rcu() changes to save power will slow down RCU workqueue items
> > queued via queue_rcu_work(). This may not be an issue, however we cannot
> > assume that workqueue users are OK with long delays. Use
> > call_rcu_flush() API instead which reverts to the old behavio
>
> On ChromeOS, I can see that queue_rcu_work() is pretty noisy and the
> batching is much better if we can just keep it as call_rcu() instead
> of call_rcu_flush().
>
> Is there really any reason to keep it as call_rcu_flush() ? If I
> recall, the real reason Vlad's system was slowing down was because of
> scsi and the queue_rcu_work() conversion was really a red herring.
There are less than 20 invocations of queue_rcu_work(), so it should
be possible look through each. The low-risk approach is of course to
have queue_rcu_work() use call_rcu_flush().
The next approach might be to have a Kconfig option and/or kernel
boot parameter that allowed a per-system choice.
But it would not hurt to double-check on Android.
Thanx, Paul
> Vlad, any thoughts?
>
> thanks,
>
> - Joel
>
> .
> >
> > Signed-off-by: Uladzislau Rezki <urezki@...il.com>
> > Signed-off-by: Joel Fernandes (Google) <joel@...lfernandes.org>
> > Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
> > ---
> > kernel/workqueue.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> > index 7cd5f5e7e0a1b..b4b0e828b529e 100644
> > --- a/kernel/workqueue.c
> > +++ b/kernel/workqueue.c
> > @@ -1771,7 +1771,7 @@ bool queue_rcu_work(struct workqueue_struct *wq, struct rcu_work *rwork)
> >
> > if (!test_and_set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work))) {
> > rwork->wq = wq;
> > - call_rcu(&rwork->rcu, rcu_work_rcufn);
> > + call_rcu_flush(&rwork->rcu, rcu_work_rcufn);
> > return true;
> > }
> >
> > --
> > 2.31.1.189.g2e36527f23
> >
Powered by blists - more mailing lists