Commit 4f24bfcc authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'sched_ext-for-6.16-rc2-fixes' of...

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 sched-ext@lists.linux.dev 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
parents 61f4769a 33796b91
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22174,7 +22174,7 @@ R: Tejun Heo <tj@kernel.org>
R:	David Vernet <void@manifault.com>
R:	Andrea Righi <arighi@nvidia.com>
R:	Changwoo Min <changwoo@igalia.com>
L:	linux-kernel@vger.kernel.org
L:	sched-ext@lists.linux.dev
S:	Maintained
W:	https://github.com/sched-ext/scx
T:	git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git
+2 −2
Original line number Diff line number Diff line
@@ -8545,7 +8545,7 @@ void __init sched_init(void)
		init_cfs_bandwidth(&root_task_group.cfs_bandwidth, NULL);
#endif /* CONFIG_FAIR_GROUP_SCHED */
#ifdef CONFIG_EXT_GROUP_SCHED
		root_task_group.scx_weight = CGROUP_WEIGHT_DFL;
		scx_tg_init(&root_task_group);
#endif /* CONFIG_EXT_GROUP_SCHED */
#ifdef CONFIG_RT_GROUP_SCHED
		root_task_group.rt_se = (struct sched_rt_entity **)ptr;
@@ -8985,7 +8985,7 @@ struct task_group *sched_create_group(struct task_group *parent)
	if (!alloc_rt_sched_group(tg, parent))
		goto err;

	scx_group_set_weight(tg, CGROUP_WEIGHT_DFL);
	scx_tg_init(tg);
	alloc_uclamp_sched_group(tg, parent);

	return tg;
+11 −6
Original line number Diff line number Diff line
@@ -4092,6 +4092,11 @@ bool scx_can_stop_tick(struct rq *rq)
DEFINE_STATIC_PERCPU_RWSEM(scx_cgroup_rwsem);
static bool scx_cgroup_enabled;

void scx_tg_init(struct task_group *tg)
{
	tg->scx_weight = CGROUP_WEIGHT_DFL;
}

int scx_tg_online(struct task_group *tg)
{
	struct scx_sched *sch = scx_root;
@@ -4241,12 +4246,12 @@ void scx_group_set_weight(struct task_group *tg, unsigned long weight)

	percpu_down_read(&scx_cgroup_rwsem);

	if (scx_cgroup_enabled && tg->scx_weight != weight) {
		if (SCX_HAS_OP(sch, cgroup_set_weight))
	if (scx_cgroup_enabled && SCX_HAS_OP(sch, cgroup_set_weight) &&
	    tg->scx_weight != weight)
		SCX_CALL_OP(sch, SCX_KF_UNLOCKED, cgroup_set_weight, NULL,
			    tg_cgrp(tg), weight);

	tg->scx_weight = weight;
	}

	percpu_up_read(&scx_cgroup_rwsem);
}
+2 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ static inline void scx_update_idle(struct rq *rq, bool idle, bool do_notify) {}

#ifdef CONFIG_CGROUP_SCHED
#ifdef CONFIG_EXT_GROUP_SCHED
void scx_tg_init(struct task_group *tg);
int scx_tg_online(struct task_group *tg);
void scx_tg_offline(struct task_group *tg);
int scx_cgroup_can_attach(struct cgroup_taskset *tset);
@@ -88,6 +89,7 @@ void scx_cgroup_cancel_attach(struct cgroup_taskset *tset);
void scx_group_set_weight(struct task_group *tg, unsigned long cgrp_weight);
void scx_group_set_idle(struct task_group *tg, bool idle);
#else	/* CONFIG_EXT_GROUP_SCHED */
static inline void scx_tg_init(struct task_group *tg) {}
static inline int scx_tg_online(struct task_group *tg) { return 0; }
static inline void scx_tg_offline(struct task_group *tg) {}
static inline int scx_cgroup_can_attach(struct cgroup_taskset *tset) { return 0; }