linux-stable/kernel/sched
Tejun Heo 57ec081869 sched_ext, sched/core: Don't call scx_group_set_weight() prematurely from sched_create_group()
commit 33796b9187 upstream.

During task_group creation, sched_create_group() calls
scx_group_set_weight() with CGROUP_WEIGHT_DFL to initialize the sched_ext
portion. This is premature and ends up calling ops.cgroup_set_weight() with
an incorrect @cgrp before ops.cgroup_init() is called.

sched_create_group() should just initialize SCX related fields in the new
task_group. Fix it by factoring out scx_tg_init() from sched_init() and
making sched_create_group() call that function instead of
scx_group_set_weight().

v2: Retain CONFIG_EXT_GROUP_SCHED ifdef in sched_init() as removing it leads
    to build failures on !CONFIG_GROUP_SCHED configs.

Signed-off-by: Tejun Heo <tj@kernel.org>
Fixes: 8195136669 ("sched_ext: Add cgroup support")
Cc: stable@vger.kernel.org # v6.12+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-27 11:11:38 +01:00
..
autogroup.c
autogroup.h
build_policy.c
build_utility.c
clock.c
completion.c
core_sched.c
core.c sched_ext, sched/core: Don't call scx_group_set_weight() prematurely from sched_create_group() 2025-06-27 11:11:38 +01:00
cpuacct.c
cpudeadline.c
cpudeadline.h
cpufreq_schedutil.c cpufreq/sched: Explicitly synchronize limits_changed flag handling 2025-04-25 10:47:52 +02:00
cpufreq.c
cpupri.c
cpupri.h
cputime.c
deadline.c sched/deadline: Use online cpus for validating runtime 2025-04-10 14:39:30 +02:00
debug.c
ext.c sched_ext, sched/core: Don't call scx_group_set_weight() prematurely from sched_create_group() 2025-06-27 11:11:38 +01:00
ext.h sched_ext, sched/core: Don't call scx_group_set_weight() prematurely from sched_create_group() 2025-06-27 11:11:38 +01:00
fair.c sched: Reduce the default slice to avoid tasks getting an extra tick 2025-05-29 11:02:50 +02:00
features.h
idle.c
isolation.c
loadavg.c
Makefile
membarrier.c
pelt.c
pelt.h
psi.c
rt.c
sched-pelt.h
sched.h
smp.h
stats.c
stats.h
stop_task.c
swait.c
syscalls.c
topology.c
wait_bit.c
wait.c