Commit ec010333 authored by Tejun Heo's avatar Tejun Heo

sched_ext: scx_cgroup_exit() may be called without successful scx_cgroup_init()

568894ed ("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: default avatarTejun Heo <tj@kernel.org>
Fixes: 568894ed ("sched_ext: Add scx_cgroup_enabled to gate cgroup operations and fix scx_tg_online()")
parent cc9877fb
......@@ -4052,7 +4052,6 @@ static void scx_cgroup_exit(void)
percpu_rwsem_assert_held(&scx_cgroup_rwsem);
WARN_ON_ONCE(!scx_cgroup_enabled);
scx_cgroup_enabled = false;
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment