Skip to content

Commit 749989b

Browse files
devnexenhtejun
authored andcommitted
sched_ext: Fix SCX_EFLAG_INITIALIZED being a no-op flag
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. Fixes: f3aec2a ("sched_ext: Add SCX_EFLAG_INITIALIZED to indicate successful ops.init()") Signed-off-by: David Carlier <devnexen@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 2a06426 commit 749989b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/sched/ext_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ enum scx_exit_flags {
7474
* info communication. The following flag indicates whether ops.init()
7575
* finished successfully.
7676
*/
77-
SCX_EFLAG_INITIALIZED,
77+
SCX_EFLAG_INITIALIZED = 1LLU << 0,
7878
};
7979

8080
/*

0 commit comments

Comments
 (0)