Skip to content

Commit 4f24bfc

Browse files
committed
Merge tag 'sched_ext-for-6.16-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext
Pull sched_ext fixes from Tejun Heo: - Fix a couple bugs in cgroup cpu.weight support - Add the new [email protected] to MAINTAINERS * tag 'sched_ext-for-6.16-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext: sched_ext, sched/core: Don't call scx_group_set_weight() prematurely from sched_create_group() sched_ext: Make scx_group_set_weight() always update tg->scx.weight sched_ext: Update mailing list entry in MAINTAINERS
2 parents 61f4769 + 33796b9 commit 4f24bfc

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22174,7 +22174,7 @@ R: Tejun Heo <[email protected]>
2217422174
R: David Vernet <[email protected]>
2217522175
R: Andrea Righi <[email protected]>
2217622176
R: Changwoo Min <[email protected]>
22177-
22177+
2217822178
S: Maintained
2217922179
W: https://github.com/sched-ext/scx
2218022180
T: git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git

kernel/sched/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8545,7 +8545,7 @@ void __init sched_init(void)
85458545
init_cfs_bandwidth(&root_task_group.cfs_bandwidth, NULL);
85468546
#endif /* CONFIG_FAIR_GROUP_SCHED */
85478547
#ifdef CONFIG_EXT_GROUP_SCHED
8548-
root_task_group.scx_weight = CGROUP_WEIGHT_DFL;
8548+
scx_tg_init(&root_task_group);
85498549
#endif /* CONFIG_EXT_GROUP_SCHED */
85508550
#ifdef CONFIG_RT_GROUP_SCHED
85518551
root_task_group.rt_se = (struct sched_rt_entity **)ptr;
@@ -8985,7 +8985,7 @@ struct task_group *sched_create_group(struct task_group *parent)
89858985
if (!alloc_rt_sched_group(tg, parent))
89868986
goto err;
89878987

8988-
scx_group_set_weight(tg, CGROUP_WEIGHT_DFL);
8988+
scx_tg_init(tg);
89898989
alloc_uclamp_sched_group(tg, parent);
89908990

89918991
return tg;

kernel/sched/ext.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4092,6 +4092,11 @@ bool scx_can_stop_tick(struct rq *rq)
40924092
DEFINE_STATIC_PERCPU_RWSEM(scx_cgroup_rwsem);
40934093
static bool scx_cgroup_enabled;
40944094

4095+
void scx_tg_init(struct task_group *tg)
4096+
{
4097+
tg->scx_weight = CGROUP_WEIGHT_DFL;
4098+
}
4099+
40954100
int scx_tg_online(struct task_group *tg)
40964101
{
40974102
struct scx_sched *sch = scx_root;
@@ -4241,12 +4246,12 @@ void scx_group_set_weight(struct task_group *tg, unsigned long weight)
42414246

42424247
percpu_down_read(&scx_cgroup_rwsem);
42434248

4244-
if (scx_cgroup_enabled && tg->scx_weight != weight) {
4245-
if (SCX_HAS_OP(sch, cgroup_set_weight))
4246-
SCX_CALL_OP(sch, SCX_KF_UNLOCKED, cgroup_set_weight, NULL,
4247-
tg_cgrp(tg), weight);
4248-
tg->scx_weight = weight;
4249-
}
4249+
if (scx_cgroup_enabled && SCX_HAS_OP(sch, cgroup_set_weight) &&
4250+
tg->scx_weight != weight)
4251+
SCX_CALL_OP(sch, SCX_KF_UNLOCKED, cgroup_set_weight, NULL,
4252+
tg_cgrp(tg), weight);
4253+
4254+
tg->scx_weight = weight;
42504255

42514256
percpu_up_read(&scx_cgroup_rwsem);
42524257
}

kernel/sched/ext.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ static inline void scx_update_idle(struct rq *rq, bool idle, bool do_notify) {}
7979

8080
#ifdef CONFIG_CGROUP_SCHED
8181
#ifdef CONFIG_EXT_GROUP_SCHED
82+
void scx_tg_init(struct task_group *tg);
8283
int scx_tg_online(struct task_group *tg);
8384
void scx_tg_offline(struct task_group *tg);
8485
int scx_cgroup_can_attach(struct cgroup_taskset *tset);
@@ -88,6 +89,7 @@ void scx_cgroup_cancel_attach(struct cgroup_taskset *tset);
8889
void scx_group_set_weight(struct task_group *tg, unsigned long cgrp_weight);
8990
void scx_group_set_idle(struct task_group *tg, bool idle);
9091
#else /* CONFIG_EXT_GROUP_SCHED */
92+
static inline void scx_tg_init(struct task_group *tg) {}
9193
static inline int scx_tg_online(struct task_group *tg) { return 0; }
9294
static inline void scx_tg_offline(struct task_group *tg) {}
9395
static inline int scx_cgroup_can_attach(struct cgroup_taskset *tset) { return 0; }

0 commit comments

Comments
 (0)