Re: [PATCH v2 5/6] osnoise: handle quiescent states for PREEMPT_RCU=n, PREEMPTION=y

From: Sebastian Andrzej Siewior
Date: Thu Nov 14 2024 - 04:22:35 EST


On 2024-11-06 12:17:57 [-0800], Ankur Arora wrote:
> To reduce RCU noise for nohz_full configurations, osnoise depends
> on cond_resched() providing quiescent states for PREEMPT_RCU=n
> configurations. And, for PREEMPT_RCU=y configurations does this
> by directly calling rcu_momentary_eqs().
>
> With PREEMPT_LAZY=y, however, we can have configurations with
> (PREEMPTION=y, PREEMPT_RCU=n), which means neither of the above
> can help.

The problem is as you say CONFIG_PREEMPT_RCU=n + CONFIG_PREEMPTION=y.
You can't select any of those two directly but get here via
PREEMPT_LAZY=y + PREEMPT_DYNAMIC=n.

Please spell it out to make it obvious. It is not a large group of
configurations, it is exactly this combo.

With PREEMPT_LAZY=y + PREEMPT_DYNAMIC=n however we get PREEMPT_RCU=n
which means no direct rcu_momentary_eqs() invocations and
cond_resched() is an empty stub.

> Handle that by fallback to the explicit quiescent states via
> rcu_momentary_eqs().

> Cc: Paul E. McKenney <paulmck@xxxxxxxxxx>
> Cc: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>
> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
> Suggested-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
> Acked-by: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>
> Signed-off-by: Ankur Arora <ankur.a.arora@xxxxxxxxxx>

Sebastian