* [PATCH] sched_ext: Fix SCX_EFLAG_INITIALIZED being a no-op flag
@ 2026-02-26 12:45 David Carlier
2026-02-26 22:07 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: David Carlier @ 2026-02-26 12:45 UTC (permalink / raw)
To: Tejun Heo, David Vernet; +Cc: linux-kernel, David Carlier
SCX_EFLAG_INITIALIZED is the sole member of enum scx_exit_flags with no
explicit value, so the compiler assigns it 0. This makes the bitwise OR
in scx_ops_init() a no-op:
sch->exit_info->flags |= SCX_EFLAG_INITIALIZED; /* |= 0 */
As a result, BPF schedulers cannot distinguish whether ops.init()
completed successfully by inspecting exit_info->flags.
Assign the value 1LLU << 0 so the flag is actually set.
Signed-off-by: David Carlier <devnexen@gmail.com>
---
kernel/sched/ext_internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/ext_internal.h b/kernel/sched/ext_internal.h
index 386c677e4c9a..11ebb744d893 100644
--- a/kernel/sched/ext_internal.h
+++ b/kernel/sched/ext_internal.h
@@ -74,7 +74,7 @@ enum scx_exit_flags {
* info communication. The following flag indicates whether ops.init()
* finished successfully.
*/
- SCX_EFLAG_INITIALIZED,
+ SCX_EFLAG_INITIALIZED = 1LLU << 0,
};
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sched_ext: Fix SCX_EFLAG_INITIALIZED being a no-op flag
2026-02-26 12:45 [PATCH] sched_ext: Fix SCX_EFLAG_INITIALIZED being a no-op flag David Carlier
@ 2026-02-26 22:07 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2026-02-26 22:07 UTC (permalink / raw)
To: David Carlier, David Vernet; +Cc: linux-kernel
Hello,
Applied to sched_ext/for-7.0-fixes with Fixes tag added.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-26 22:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-26 12:45 [PATCH] sched_ext: Fix SCX_EFLAG_INITIALIZED being a no-op flag David Carlier
2026-02-26 22:07 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox