Re: Scenario TREE07 with CONFIG_PREEMPT_DYNAMIC=n?

From: Paul E. McKenney
Date: Fri Mar 11 2022 - 12:33:27 EST


On Fri, Mar 11, 2022 at 06:26:20PM +0100, Frederic Weisbecker wrote:
> On Fri, Mar 11, 2022 at 08:47:58AM -0800, Paul E. McKenney wrote:
> > And there is one more issue with this code. Someone invoking
> > get_state_synchronize_rcu_expedited() in one task might naively expect
> > that calls to synchronize_rcu_expedited() in some other task would cause
> > a later poll_state_synchronize_rcu_expedited() would return true.
> >
> > Except that if CONFIG_PREEMPT_NONE=y and there is only one CPU, those
> > calls to synchronize_rcu_expedited() won't be helping at all.
> >
> > I could imagine poll_state_synchronize_rcu_expedited() setting a
> > global flag if there is only one CPU, which could be checked by
> > __synchronize_rcu_expedited() and reset.
> >
> > Is there a better way?
>
> I would tend to think that in this case, it's the responsibility of the
> caller to make sure that the task supposed to start the exp GP has a chance
> to run (cond_resched(), etc...).

Hahahahahahaha!

The same problem arises for poll_state_synchronize_rcu() and friends
on a single-CPU CONFIG_PREEMPT_NONE=y system.

Thanx, Paul