[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260119-sched-rert_groups-v1-2-80c1e5269910@suse.com>
Date: Mon, 19 Jan 2026 18:41:20 +0100
From: Michal Koutný <mkoutny@...e.com>
To: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>,
Mel Gorman <mgorman@...e.de>, Valentin Schneider <vschneid@...hat.com>
Cc: linux-kernel@...r.kernel.org,
Michal Koutný <mkoutny@...e.com>
Subject: [PATCH 2/3] sched/rt: Move group schedulability check to
sched_rt_global_validate()
The sched_rt_global_constraints() function is a remnant that used to set
up global RT throttling but that is no more since commit 5f6bd380c7bdb
("sched/rt: Remove default bandwidth control") and the function ended up
only doing schedulability check.
Move the check into the validation function where it fits better.
(The order of validations sched_dl_global_validate() and
sched_rt_global_validate() shouldn't matter.)
Signed-off-by: Michal Koutný <mkoutny@...e.com>
---
kernel/sched/rt.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 2dfdf2d9471be..c621e61568359 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -2810,15 +2810,7 @@ long sched_group_rt_period(struct task_group *tg)
#ifdef CONFIG_SYSCTL
static int sched_rt_global_constraints(void)
{
- int ret = 0;
- if (!rt_group_sched_enabled())
- return ret;
-
- mutex_lock(&rt_constraints_mutex);
- ret = __rt_schedulable(NULL, 0, 0);
- mutex_unlock(&rt_constraints_mutex);
-
- return ret;
+ return 0;
}
#endif /* CONFIG_SYSCTL */
@@ -2850,7 +2842,16 @@ static int sched_rt_global_validate(void)
NSEC_PER_USEC > max_rt_runtime)))
return -EINVAL;
- return 0;
+ int ret = 0;
+#ifdef CONFIG_RT_GROUP_SCHED
+ if (!rt_group_sched_enabled())
+ return ret;
+
+ mutex_lock(&rt_constraints_mutex);
+ ret = __rt_schedulable(NULL, 0, 0);
+ mutex_unlock(&rt_constraints_mutex);
+#endif
+ return ret;
}
static void sched_rt_do_global(void)
--
2.52.0
Powered by blists - more mailing lists