mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH sched_ext/for-6.12-fixes] sched_ext: scx_cgroup_exit() may be called without successful scx_cgroup_init()
@ 2024-10-02 20:34 Tejun Heo
  2024-10-04 20:12 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2024-10-02 20:34 UTC (permalink / raw)
  To: David Vernet; +Cc: linux-kernel, kernel-team, sched-ext

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 |    1 -
 1 file changed, 1 deletion(-)

--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -4119,7 +4119,6 @@ static void scx_cgroup_exit(void)
 
 	percpu_rwsem_assert_held(&scx_cgroup_rwsem);
 
-	WARN_ON_ONCE(!scx_cgroup_enabled);
 	scx_cgroup_enabled = false;
 
 	/*

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH sched_ext/for-6.12-fixes] sched_ext: scx_cgroup_exit() may be called without successful scx_cgroup_init()
  2024-10-02 20:34 [PATCH sched_ext/for-6.12-fixes] sched_ext: scx_cgroup_exit() may be called without successful scx_cgroup_init() Tejun Heo
@ 2024-10-04 20:12 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2024-10-04 20:12 UTC (permalink / raw)
  To: David Vernet; +Cc: linux-kernel, kernel-team, sched-ext

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@kernel.org>
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-04 20:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-02 20:34 [PATCH sched_ext/for-6.12-fixes] sched_ext: scx_cgroup_exit() may be called without successful scx_cgroup_init() Tejun Heo
2024-10-04 20:12 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®