[PATCH v3 4/8] sched: rcutorture: Allow to disable DL fair_server

From: Sebastian Andrzej Siewior

Date: Fri Nov 13 2026 - 06:31:29 EST


The rcutorture test used to disable RT throttling only in the built-in
mode and this functionality got lost while RT throttling was moved to
the fair_server.
Enabling this option (built-in) slows down the system considerably.
Therefore it makes little sense to enable the fair_server once the test
is done since a reboot comes next.

The fair server can not be disabled from the hotplug notifier because
the CPU must be marked active. Instead of this off-switch an alternative
would be to skip sched_init_dl_servers().

Add dl_server_fair_disable() do disable the fair_server which can only
be used by rcutorture. Use dl_server_fair_disable() in
rcu_torture_boost() which is invoked on the CPU which should have the
fair_server disabled.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
---
kernel/rcu/rcutorture.c | 4 ++++
kernel/sched/deadline.c | 28 ++++++++++++++++++++++++++++
2 files changed, 32 insertions(+)

diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index aecc4da7161bb..5c434cb3ef732 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1333,6 +1333,8 @@ static unsigned long rcutorture_seq_diff(unsigned long new, unsigned long old)
return cur_ops->gp_diff(new, old);
}

+void dl_server_fair_disable(unsigned int cpu);
+
static bool rcu_torture_boost_failed(unsigned long gp_state, unsigned long *start)
{
int cpu;
@@ -1402,6 +1404,8 @@ static int rcu_torture_boost(void *arg)
}
VERBOSE_TOROUT_STRING("rcu_torture_boost finished holdoff period");
}
+ if (IS_BUILTIN(CONFIG_RCU_TORTURE_TEST))
+ dl_server_fair_disable(smp_processor_id());

/* Set real-time priority. */
sched_set_fifo_low(current);
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 10beb54281881..a713ad9dd6208 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1950,6 +1950,34 @@ int dl_server_apply_params(struct sched_dl_entity *dl_se, u64 runtime, u64 perio
return 0;
}

+#ifdef CONFIG_RCU_TORTURE_TEST
+/*
+ * The RCU-TORTURE built-in test will disable fair-server to avoid any
+ * throttling while testing RCU-boosting.
+ * If compiled as module then the user needs to disable it manually before
+ * loading the module.
+ */
+void dl_server_fair_disable(unsigned int cpu);
+
+void dl_server_fair_disable(unsigned int cpu)
+{
+ struct rq *rq = cpu_rq(cpu);
+ int retval;
+
+ scoped_guard (rq_lock_irqsave, rq) {
+ struct sched_dl_entity *dl_se = &rq->fair_server;
+
+ if (dl_se->dl_runtime == 0)
+ return;
+
+ update_rq_clock(rq);
+ dl_server_stop(dl_se);
+ retval = dl_server_apply_params(dl_se, 0, dl_se->dl_period, 0);
+ }
+ WARN_ON_ONCE(retval);
+}
+#endif
+
/*
* Add @dl_se's bw to the root-domain accounting.
*

--
2.55.0