Skip to content

Commit b4f0a37

Browse files
Werkovgregkh
authored andcommitted
sched/rt: Skip group schedulable check with rt_group_sched=0
[ Upstream commit 8b016dc ] The warning from the commit 87f1fb7 ("sched: Add RT_GROUP WARN checks for non-root task_groups") is wrong -- it assumes that only task_groups with rt_rq are traversed, however, the schedulability check would iterate all task_groups even when rt_group_sched=0 is disabled at boot time but some non-root task_groups exist. The schedulability check is supposed to validate: a) that children don't overcommit its parent, b) no RT task group overcommits global RT limit. but with rt_group_sched=0 there is no (non-trivial) hierarchy of RT groups, therefore skip the validation altogether. Otherwise, writes to the global sched_rt_runtime_us knob will be rejected with incorrect validation error. This fix is immaterial with CONFIG_RT_GROUP_SCHED=n. Fixes: 87f1fb7 ("sched: Add RT_GROUP WARN checks for non-root task_groups") Signed-off-by: Michal Koutný <mkoutny@suse.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20260323-sched-rert_groups-v3-1-1e7d5ed6b249@suse.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4bd99f4 commit b4f0a37

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

kernel/sched/rt.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,9 +2668,6 @@ static int tg_rt_schedulable(struct task_group *tg, void *data)
26682668
tg->rt_bandwidth.rt_runtime && tg_has_rt_tasks(tg))
26692669
return -EBUSY;
26702670

2671-
if (WARN_ON(!rt_group_sched_enabled() && tg != &root_task_group))
2672-
return -EBUSY;
2673-
26742671
total = to_ratio(period, runtime);
26752672

26762673
/*
@@ -2814,6 +2811,8 @@ long sched_group_rt_period(struct task_group *tg)
28142811
static int sched_rt_global_constraints(void)
28152812
{
28162813
int ret = 0;
2814+
if (!rt_group_sched_enabled())
2815+
return ret;
28172816

28182817
mutex_lock(&rt_constraints_mutex);
28192818
ret = __rt_schedulable(NULL, 0, 0);

0 commit comments

Comments
 (0)