Re: [PATCH 2/7] rcu: limit PREEMPT_RCU configurations
From: Paul E. McKenney
Date: Fri Oct 11 2024 - 10:00:07 EST
On Fri, Oct 11, 2024 at 10:18:47AM +0200, Sebastian Andrzej Siewior wrote:
> On 2024-10-10 07:29:07 [-0700], Paul E. McKenney wrote:
> > If you have PREEMPT_RT, you need preemptible RCU, so the defaults should
> > supply it.
> >
> > If you have PREEMPT_DYNAMIC, presumably you would like to boot with
> > preemption enabled, and would like it to act as if you had built the
> > kernel to be unconditionally preemptible, so again you need preemptible
> > RCU, and so the defaults should supply it.
> >
> > If you started off building a non-preemptible kernel, then you are not
> > using one of the major distros (last I checked). There is a good chance
> > that you have a large number of systems, and are thus deeply interested
> > in minimizing memory cost. In which case, you need non-preemptible
> > RCU in the new-age lazy-preemptible kernel.
> >
> > Hence the choice of non-preemptible RCU as the default in a kernel that,
> > without lazy preemption, would use non-preemptible RCU.
>
> I *think* I slowly begin to understand. So we have LAZY and DYNAMIC
> enabled then and PREEMPT_RCU depends on the default choice which is
> either FULL (yes, please) or NONE/VOLUNTARY (no, thank you). But then if
> you change the model at runtime (or boottime) from (default) NONE to
> FULL you don't have preemptible RCU anymore.
Almost. If you are able to change the model at boot time or at run time,
then you *always* have preemptible RCU.
> If you would like to add some relief to memory constrained systems,
> wouldn't BASE_SMALL be something you could hook to? With EXPERT_RCU to
> allow to override it?
Does BASE_SMALL affect anything but log buffer sizes? Either way, we
would still need to avoid the larger memory footprint of preemptible
RCU that shows up due to RCU readers being preempted.
Besides, we are not looking to give up performance vs BASE_SMALL's
"may reduce performance" help text.
Yes, yes, it would simplify things to just get rid of non-preemptible RCU,
but that is simply not in the cards at the moment.
Thanx, Paul