Commit 33796b9
committed
sched_ext, sched/core: Don't call scx_group_set_weight() prematurely from sched_create_group()
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: 8195136 ("sched_ext: Add cgroup support")
Cc: stable@vger.kernel.org # v6.12+1 parent c50784e commit 33796b9
3 files changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8545 | 8545 | | |
8546 | 8546 | | |
8547 | 8547 | | |
8548 | | - | |
| 8548 | + | |
8549 | 8549 | | |
8550 | 8550 | | |
8551 | 8551 | | |
| |||
8985 | 8985 | | |
8986 | 8986 | | |
8987 | 8987 | | |
8988 | | - | |
| 8988 | + | |
8989 | 8989 | | |
8990 | 8990 | | |
8991 | 8991 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4092 | 4092 | | |
4093 | 4093 | | |
4094 | 4094 | | |
| 4095 | + | |
| 4096 | + | |
| 4097 | + | |
| 4098 | + | |
| 4099 | + | |
4095 | 4100 | | |
4096 | 4101 | | |
4097 | 4102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| 92 | + | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| |||
0 commit comments