Re: [PATCH v2] rcu: Provide a boot time parameter to control lazy RCU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 13, 2023 at 5:35 AM Uladzislau Rezki <urezki@xxxxxxxxx> wrote:
[....]
> > > > +       Use rcutree.enable_rcu_lazy=0 to turn it off at boot time.
> > > > +
> > > > +config RCU_LAZY_DEFAULT_OFF
> > > > +     bool "Turn RCU lazy invocation off by default"
> > > > +     depends on RCU_LAZY
> > > > +     default n
> > > > +     help
> > > > +       Allows building the kernel with CONFIG_RCU_LAZY=y yet keep it default
> > > > +       off. Boot time param rcutree.enable_rcu_lazy=1 can be used to switch
> > > > +       it back on.
> > > > +
> > > >  config RCU_DOUBLE_CHECK_CB_TIME
> > > >       bool "RCU callback-batch backup time check"
> > > >       depends on RCU_EXPERT
> > > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > > > index 3ac3c846105f..8b7675624815 100644
> > > > --- a/kernel/rcu/tree.c
> > > > +++ b/kernel/rcu/tree.c
> > > > @@ -2719,6 +2719,9 @@ __call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy_in)
> > > >  }
> > > >
> > > >  #ifdef CONFIG_RCU_LAZY
> > > > +static bool enable_rcu_lazy __read_mostly = !IS_ENABLED(CONFIG_RCU_LAZY_DEFAULT_OFF);
> > > > +module_param(enable_rcu_lazy, bool, 0444);
> > > > +
> > > >  /**
> > > >   * call_rcu_hurry() - Queue RCU callback for invocation after grace period, and
> > > >   * flush all lazy callbacks (including the new one) to the main ->cblist while
> > > > @@ -2744,6 +2747,8 @@ void call_rcu_hurry(struct rcu_head *head, rcu_callback_t func)
> > > >       __call_rcu_common(head, func, false);
> > > >  }
> > > >  EXPORT_SYMBOL_GPL(call_rcu_hurry);
> > > > +#else
> > > > +#define enable_rcu_lazy              false
> > > >  #endif
> > > >
> > > >  /**
> > > > @@ -2792,7 +2797,7 @@ EXPORT_SYMBOL_GPL(call_rcu_hurry);
> > > >   */
> > > >  void call_rcu(struct rcu_head *head, rcu_callback_t func)
> > > >  {
> > > > -     __call_rcu_common(head, func, IS_ENABLED(CONFIG_RCU_LAZY));
> > > > +     __call_rcu_common(head, func, enable_rcu_lazy);
> > > >  }
> > > >  EXPORT_SYMBOL_GPL(call_rcu);
> > > >
> > > I think, it makes sense. Especially for devices/systems where it is hard
> > > to recompile the kernel and deploy it. For example, Google and GKI approach.
> >
> > My concerns had nothing to do with recompiling the kernel. Passing a
> > boot parameter (without a kernel compile) can just as well
> > default-disable the feature.
> >
> > I think what Qais is saying is that passing a boot parameter is itself
> > a hassle in Android (something I did not know about) because of GKI
> > etc.
> >
> That is true. Doing:
>
> echo 1 > /sys/.../enable_lazy
>
> is a way how to make it easy and flexible.

Hey Vlad, are you suggesting that the boot parameter be made to
support runtime? We can keep that for later as it may get complicated.
Qais's boot parameter is designed only for boot time.

Qais, could you resend the patch with our tags and updated description? Thanks,

 - Joel





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux