Skip to content

Commit 7f80c0d

Browse files
committed
sched_ext: Make scx_group_set_weight() always update tg->scx.weight
JIRA: https://issues.redhat.com/browse/RHEL-111810 commit c50784e Author: Tejun Heo <tj@kernel.org> Date: Fri Jun 13 13:23:07 2025 -1000 sched_ext: Make scx_group_set_weight() always update tg->scx.weight Otherwise, tg->scx.weight can go out of sync while scx_cgroup is not enabled and ops.cgroup_init() may be called with a stale weight value. Signed-off-by: Tejun Heo <tj@kernel.org> Fixes: 8195136 ("sched_ext: Add cgroup support") Cc: stable@vger.kernel.org # v6.12+ Signed-off-by: Phil Auld <pauld@redhat.com>
1 parent b583abf commit 7f80c0d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kernel/sched/ext.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4205,12 +4205,12 @@ void scx_group_set_weight(struct task_group *tg, unsigned long weight)
42054205

42064206
percpu_down_read(&scx_cgroup_rwsem);
42074207

4208-
if (scx_cgroup_enabled && tg->scx_weight != weight) {
4209-
if (SCX_HAS_OP(sch, cgroup_set_weight))
4210-
SCX_CALL_OP(sch, SCX_KF_UNLOCKED, cgroup_set_weight, NULL,
4211-
tg_cgrp(tg), weight);
4212-
tg->scx_weight = weight;
4213-
}
4208+
if (scx_cgroup_enabled && SCX_HAS_OP(sch, cgroup_set_weight) &&
4209+
tg->scx_weight != weight)
4210+
SCX_CALL_OP(sch, SCX_KF_UNLOCKED, cgroup_set_weight, NULL,
4211+
tg_cgrp(tg), weight);
4212+
4213+
tg->scx_weight = weight;
42144214

42154215
percpu_up_read(&scx_cgroup_rwsem);
42164216
}

0 commit comments

Comments
 (0)