[PATCH v2 3/7] sched: rcutorture: Allow to disable DL fair_server

From: Sebastian Andrzej Siewior

Date: Tue Nov 10 2026 - 13:07:25 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.

Add dl_server_fair_disable() do disable the fair_server which can only
be used by rcutorture.

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

diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index aecc4da7161bb..f6f1c0eb2dc73 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;
@@ -3394,6 +3396,8 @@ static int rcutorture_booster_init(unsigned int cpu)

/* Don't allow time recalculation while creating a new task. */
mutex_lock(&boost_mutex);
+ if (IS_BUILTIN(CONFIG_RCU_TORTURE_TEST))
+ dl_server_fair_disable(cpu);
VERBOSE_TOROUT_STRING("Creating rcu_torture_boost task");
boost_tasks[cpu] = kthread_run_on_cpu(rcu_torture_boost, NULL,
cpu, "rcu_torture_boost_%u");
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index dfae08625342e..24633af261be6 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1947,6 +1947,31 @@ 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;
+
+ 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