All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] sched: Disable DL server if sysctl_sched_rt_runtime is -1
@ 2025-03-04 20:01 Joel Fernandes
  2025-03-04 20:06 ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Joel Fernandes @ 2025-03-04 20:01 UTC (permalink / raw)
  To: linux-kernel, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider
  Cc: Joel Fernandes

Currently, RCU boost testing in rcutorture is broken because it relies on
having RT throttling disabled. This means the test will always pass (or
rarely fail). This occurs because recently, RT throttling was replaced
by DL server which boosts CFS tasks even when rcutorture tried to
disable throttling (see rcu_torture_disable_rt_throttle()).

Therefore this patch prevents DL server from starting when RC torture
sets the sysctl_sched_rt_runtime to -1.

With this patch, boosting in TREE09 fails more than 50% of boost attempts
making the test more useful.

Also add a check of this to task_non_contending() because otherwise it
throws a warning (in the case when DL server was already started before
rcutorture started).

Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
---
 kernel/sched/deadline.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 38e4537790af..09c5139a3183 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -448,7 +448,7 @@ static void task_non_contending(struct sched_dl_entity *dl_se)
 	if (dl_entity_is_special(dl_se))
 		return;
 
-	WARN_ON(dl_se->dl_non_contending);
+	WARN_ON(dl_se->dl_non_contending && rt_bandwidth_enabled());
 
 	zerolag_time = dl_se->deadline -
 		 div64_long((dl_se->runtime * dl_se->dl_period),
@@ -1648,6 +1648,13 @@ void dl_server_start(struct sched_dl_entity *dl_se)
 {
 	struct rq *rq = dl_se->rq;
 
+	/*
+	 * Prevent dl_server from starting if RT bandwidth is not enabled.
+	 * This is used by test code to test RCU boosting.
+	 */
+	if (!rt_bandwidth_enabled())
+		return;
+
 	/*
 	 * XXX: the apply do not work fine at the init phase for the
 	 * fair server because things are not yet set. We need to improve
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH RFC] sched: Disable DL server if sysctl_sched_rt_runtime is -1
@ 2025-03-04 20:01 Joel Fernandes
  0 siblings, 0 replies; 6+ messages in thread
From: Joel Fernandes @ 2025-03-04 20:01 UTC (permalink / raw)
  To: linux-kernel, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider
  Cc: paulmck, rcu, Joel Fernandes

Currently, RCU boost testing in rcutorture is broken because it relies on
having RT throttling disabled. This means the test will always pass (or
rarely fail). This occurs because recently, RT throttling was replaced
by DL server which boosts CFS tasks even when rcutorture tried to
disable throttling (see rcu_torture_disable_rt_throttle()).

Therefore this patch prevents DL server from starting when RC torture
sets the sysctl_sched_rt_runtime to -1.

With this patch, boosting in TREE09 fails more than 50% of boost attempts
making the test more useful.

Also add a check of this to task_non_contending() because otherwise it
throws a warning (in the case when DL server was already started before
rcutorture started).

Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
---
 kernel/sched/deadline.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 38e4537790af..09c5139a3183 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -448,7 +448,7 @@ static void task_non_contending(struct sched_dl_entity *dl_se)
 	if (dl_entity_is_special(dl_se))
 		return;
 
-	WARN_ON(dl_se->dl_non_contending);
+	WARN_ON(dl_se->dl_non_contending && rt_bandwidth_enabled());
 
 	zerolag_time = dl_se->deadline -
 		 div64_long((dl_se->runtime * dl_se->dl_period),
@@ -1648,6 +1648,13 @@ void dl_server_start(struct sched_dl_entity *dl_se)
 {
 	struct rq *rq = dl_se->rq;
 
+	/*
+	 * Prevent dl_server from starting if RT bandwidth is not enabled.
+	 * This is used by test code to test RCU boosting.
+	 */
+	if (!rt_bandwidth_enabled())
+		return;
+
 	/*
 	 * XXX: the apply do not work fine at the init phase for the
 	 * fair server because things are not yet set. We need to improve
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-03-05 19:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-04 20:01 [PATCH RFC] sched: Disable DL server if sysctl_sched_rt_runtime is -1 Joel Fernandes
2025-03-04 20:06 ` Steven Rostedt
2025-03-04 23:47   ` Joel Fernandes
2025-03-05  9:30     ` Juri Lelli
2025-03-05 19:55       ` Joel Fernandes
  -- strict thread matches above, loose matches on Subject: below --
2025-03-04 20:01 Joel Fernandes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.