Re: Scenario TREE07 with CONFIG_PREEMPT_DYNAMIC=n?

Frederic Weisbecker
2022-03-11T17:26:27Z

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...).