sched_ext: scx_cgroup_exit() may be called without successful scx_cgroup_init()
authorTejun Heo <tj@kernel.org>
Wed, 2 Oct 2024 20:34:38 +0000 (10:34 -1000)
committerTejun Heo <tj@kernel.org>
Fri, 4 Oct 2024 20:12:11 +0000 (10:12 -1000)
commitec010333ce7cf3270ae7193a6724794d5a179625
treebd126fecadfff9cd0197b67a89307a5fb12a02f4
parentcc9877fb76771b7cbce6c9ec239f13a1d7759876
sched_ext: scx_cgroup_exit() may be called without successful scx_cgroup_init()

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@kernel.org>
Fixes: 568894edbe48 ("sched_ext: Add scx_cgroup_enabled to gate cgroup operations and fix scx_tg_online()")
kernel/sched/ext.c