Re: [PATCH sched_ext/for-6.12-fixes] sched_ext: scx_cgroup_exit() may be called without successful scx_cgroup_init()

From: Tejun Heo
Date: Fri Oct 04 2024 - 16:25:58 EST


On Wed, Oct 02, 2024 at 10:34:38AM -1000, Tejun Heo wrote:
> 568894edbe48 ("sched_ext: Add scx_cgroup_enabled to gate cgroup operations
> and fix scx_tg_online()") assumed that scx_cgroup_exit() is only called
> after scx_cgroup_init() finished successfully. This isn't true.
> scx_cgroup_exit() can be called without scx_cgroup_init() being called at
> all or after scx_cgroup_init() failed in the middle.
>
> As init state is tracked per cgroup, scx_cgroup_exit() can be used safely to
> clean up in all cases. Remove the incorrect WARN_ON_ONCE().
>
> Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
> Fixes: 568894edbe48 ("sched_ext: Add scx_cgroup_enabled to gate cgroup operations and fix scx_tg_online()")

Applied to sched_ext/for-6.12-fixes.

Thanks.

--
tejun