Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: f3aec2adce8d ("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>

authored by

David Carlier and committed by
Tejun Heo
749989b2 2a064262

+1 -1
+1 -1
kernel/sched/ext_internal.h
··· 74 74 * info communication. The following flag indicates whether ops.init() 75 75 * finished successfully. 76 76 */ 77 - SCX_EFLAG_INITIALIZED, 77 + SCX_EFLAG_INITIALIZED = 1LLU << 0, 78 78 }; 79 79 80 80 /*