Re: [PATCH 2/2 sched_ext/for-6.16-fixes] sched_ext, sched/core: Don't call scx_group_set_weight() prematurely from sched_create_group()
From: Peter Zijlstra
Date: Tue Jun 17 2025 - 04:31:15 EST
On Fri, Jun 13, 2025 at 01:25:56PM -1000, Tejun Heo wrote:
> 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().
>
> Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
> Fixes: 819513666966 ("sched_ext: Add cgroup support")
> Cc: stable@xxxxxxxxxxxxxxx # v6.12+
> ---
> Ingo, Peter, while this touches kernel/sched/core.c, the changes are trivial
> and only affect sched_ext. I'm planning to route it through
> sched_ext/for-6.14-fixes. Please holler if you want it routed through tip.
Seems fine, go ahead and take it.