summaryrefslogtreecommitdiff
path: root/kernel/sched/rt.c
diff options
context:
space:
mode:
authorMichal Koutný <mkoutny@suse.com>2025-03-10 18:04:38 +0100
committerPeter Zijlstra <peterz@infradead.org>2025-04-08 20:55:54 +0200
commit277e0909754e9f3c82def97150d2f3ea700098f1 (patch)
tree66bcdb7adc54ecea87cb003a2dde7da141a47777 /kernel/sched/rt.c
parent61d3164fec2ed283645dc17fcc51959e8f361e18 (diff)
sched: Bypass bandwitdh checks with runtime disabled RT_GROUP_SCHED
When RT_GROUPs are compiled but not exposed, their bandwidth cannot be configured (and it is not initialized for non-root task_groups neither). Therefore bypass any checks of task vs task_group bandwidth. This will achieve behavior very similar to setups that have !CONFIG_RT_GROUP_SCHED and attach cpu controller to cgroup v2 hierarchy. (On a related note, this may allow having RT tasks with CONFIG_RT_GROUP_SCHED and cgroup v2 hierarchy.) Signed-off-by: Michal Koutný <mkoutny@suse.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20250310170442.504716-7-mkoutny@suse.com
Diffstat (limited to 'kernel/sched/rt.c')
-rw-r--r--kernel/sched/rt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index efa22bad31e1..5e82bfe56fdf 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -2864,7 +2864,7 @@ static int sched_rt_global_constraints(void)
int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk)
{
/* Don't accept real-time tasks when there is no way for them to run */
- if (rt_task(tsk) && tg->rt_bandwidth.rt_runtime == 0)
+ if (rt_group_sched_enabled() && rt_task(tsk) && tg->rt_bandwidth.rt_runtime == 0)
return 0;
return 1;