Re: [PATCH v5 06/18] rcu: Introduce call_rcu_lazy() API implementation

From: Frederic Weisbecker
Date: Wed Sep 07 2022 - 06:04:00 EST


On Tue, Sep 06, 2022 at 12:15:19PM -0400, Joel Fernandes wrote:
> >> +
> >> + // We had CBs in the bypass list before. There is nothing else to do if:
> >> + // There were only non-lazy CBs before, in this case, the bypass timer
> >
> > Kind of misleading. I would replace "There were only non-lazy CBs before" with
> > "There was at least one non-lazy CBs before".
>
> I really mean "There were only non-lazy CBs ever queued in the bypass list
> before". That's the bypass_is_lazy variable. So I did not fully understand your
> suggested comment change.

I may well be missing something but to me it seems that:

bypass_is_lazy = all bypass callbacks are lazy
!bypass_is_lazy = there is at least one non-lazy bypass callback

And indeed as long as there is at least one non-lazy callback, we don't
want to rely on the LAZY timer.

Am I overlooking something?

>
> >> + // or GP-thread will handle the CBs including any new lazy ones.
> >> + // Or, the new CB is lazy and the old bypass-CBs were also lazy. In this
> >> + // case the old lazy timer would have been setup. When that expires,
> >> + // the new lazy one will be handled.
> >> + if (ncbs && (!bypass_is_lazy || lazy)) {
> >> local_irq_restore(flags);
> >> } else {
> >> // No-CBs GP kthread might be indefinitely asleep, if so, wake.