Re: [PATCH v2 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: Tejun Heo
Date: Tue Jun 17 2025 - 14:20:19 EST


On Mon, Jun 16, 2025 at 10:13:25AM -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().
>
> 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@xxxxxxxxxx>
> Fixes: 819513666966 ("sched_ext: Add cgroup support")
> Cc: stable@xxxxxxxxxxxxxxx # v6.12+

Applied 1-2 to sched_ext/for-6.16-fixes.

Thanks.

--
tejun