Commit 749989b2 authored by David Carlier's avatar David Carlier Committed by Tejun Heo
Browse files

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: f3aec2ad ("sched_ext: Add SCX_EFLAG_INITIALIZED to indicate successful ops.init()")
Signed-off-by: default avatarDavid Carlier <devnexen@gmail.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 2a064262
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,
};

/*