Skip to content

Commit

Permalink
sched_ext: scx_cgroup_exit() may be called without successful scx_cgr…
Browse files Browse the repository at this point in the history
…oup_init()

568894e ("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 <[email protected]>
Fixes: 568894e ("sched_ext: Add scx_cgroup_enabled to gate cgroup operations and fix scx_tg_online()")
  • Loading branch information
htejun committed Oct 4, 2024
1 parent cc9877f commit ec01033
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion kernel/sched/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit ec01033

Please sign in to comment.