Re: [PATCH RFC 5/7] rcu: Add rcutree.boost_disable to disable priority boosting at runtime

From: Sebastian Andrzej Siewior

Date: Fri Nov 13 2026 - 12:26:13 EST


On 2026-11-11 16:38:23 [-0500], Joel Fernandes wrote:
> CONFIG_RCU_BOOST is now enabled automatically for preemptible RCU and
> cannot be turned off, so rcutorture's BUSTED-BOOST scenario, which is
> meant to show that rcutorture detects broken priority boosting, can no
> longer break it. Add a boot parameter that makes rcu_initiate_boost()
> do nothing, giving that scenario a way to break boosting.

It has:
| depends on (RT_MUTEXES && PREEMPT_RCU && RCU_EXPERT) || PREEMPT_RT
| default y if PREEMPT_RT

which I read as always enable on PREEMPT_RT and on PREEMPT_RCU only with
RCU_EXPERT enabled which off by default.
But BUSTED-BOOST always enabled RCU_EXPERT which means it is always
enabled. Hmm.

> --- a/kernel/rcu/tree_plugin.h
> +++ b/kernel/rcu/tree_plugin.h
> @@ -1270,6 +1270,9 @@ static int rcu_boost_kthread(void *arg)
> return 0;
> }
>
> +static bool boost_disable;
> +module_param(boost_disable, bool, 0444);
> +
> /*
> * Check to see if it is time to start boosting RCU readers that are
> * blocking the current grace period, and, if so, tell the per-rcu_node
> @@ -1284,7 +1287,7 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags)
> __releases(rnp->lock)
> {
> raw_lockdep_assert_held_rcu_node(rnp);
> - if (!rnp->boost_kthread_task ||
> + if (boost_disable || !rnp->boost_kthread_task ||

Could you instead make this a parameter of rcutorture (and not rcu's)
and then check it behind IS_ENABLED(CONFIG_RCU_TORTURE_TEST)?
That way non-testing code does not have this additional read and the
variable parameter and so on.

Maybe tell rcu_spawn_one_boost_kthread() not to populate the tread this
thread in case.

> (!rcu_preempt_blocked_readers_cgp(rnp) && !rnp->exp_tasks)) {
> raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
> return;

Sebastian