Re: [PATCH 2/7] rcu: limit PREEMPT_RCU configurations
From: Peter Zijlstra
Date: Thu Oct 10 2024 - 06:03:24 EST
On Thu, Oct 10, 2024 at 11:13:26AM +0200, Sebastian Andrzej Siewior wrote:
> On 2024-10-10 10:10:32 [+0200], Peter Zijlstra wrote:
> > On Thu, Oct 10, 2024 at 08:32:07AM +0200, Sebastian Andrzej Siewior wrote:
> > > On 2024-10-09 11:24:09 [-0700], Paul E. McKenney wrote:
> > > > In order to support systems that currently run CONFIG_PREEMPT=n that
> > > …
> > > > Or am I once again missing your point?
> > >
> > > The change is:
> > > | config PREEMPT_RCU
> > > | bool
> > > |- default y if PREEMPTION
> > > |+ default y if (PREEMPT || PREEMPT_RT || PREEMPT_DYNAMIC)
> > >
> > > Now:
> > > - CONFIG_PREEMPT select PREEMPT_BUILD
> > > - PREEMPT_RT select CONFIG_PREEMPTION
> > > - PREEMPT_DYNAMIC selects PREEMPT_BUILD
> > >
> > > and PREEMPT_BUILD select CONFIG_PREEMPTION
> > >
> > > so in the end, this change is a nop, right?
> >
> > PREEMPT_RT selects PREEMPTION *and* has one of PREEMPT / PREEMPT_LAZY /
> > PREEMPT_DYNAMIC, all of which in turn select PREEMPT_BUILD, which
> > selects PREEMPTION.
> >
> > (arguably we can remove the select PREEMPTION from PREEMPT_RT)
> >
> > The proposed change is not a nop because the config: PREEMPT_LAZY=y
> > PREEMPT_DYNAMIC=n will result in false, while it will have PREEMPTION.
>
> I have a config with PREEMPT_LAZY=y PREEMPT_DYNAMIC=n and
> CONFIG_PREEMPT_RCU=y.
>
> I can't deselect CONFIG_PREEMPT_RCU=y. This is because LAZY selects
> PREEMPT_BUILD and PREEMPT_RCU selects itself once PREEMPTION is on.
Oh, the entry isn't user selectable? Fix that perhaps?
- bool
+ bool "Use preemptible RCU"
Or something along those lines -- I forever forget how Kconfig works.