]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched_ext: Fix enqueue_task_scx() truncation of upper enqueue flags
authorTejun Heo <tj@kernel.org>
Sat, 7 Mar 2026 14:53:32 +0000 (04:53 -1000)
committerTejun Heo <tj@kernel.org>
Sat, 7 Mar 2026 14:53:32 +0000 (04:53 -1000)
commit57ccf5ccdc56954f2a91a7f66684fd31c566bde5
tree5d0c81fca66a4e1138aec57b0df39548c8dc29ae
parent2a0596d516870951ce0e8edf510e48c87cb80761
sched_ext: Fix enqueue_task_scx() truncation of upper enqueue flags

enqueue_task_scx() takes int enq_flags from the sched_class interface.
SCX enqueue flags starting at bit 32 (SCX_ENQ_PREEMPT and above) are
silently truncated when passed through activate_task(). extra_enq_flags
was added as a workaround - storing high bits in rq->scx.extra_enq_flags
and OR-ing them back in enqueue_task_scx(). However, the OR target is
still the int parameter, so the high bits are lost anyway.

The current impact is limited as the only affected flag is SCX_ENQ_PREEMPT
which is informational to the BPF scheduler - its loss means the scheduler
doesn't know about preemption but doesn't cause incorrect behavior.

Fix by renaming the int parameter to core_enq_flags and introducing a
u64 enq_flags local that merges both sources. All downstream functions
already take u64 enq_flags.

Fixes: f0e1a0643a59 ("sched_ext: Implement BPF extensible scheduler class")
Cc: stable@vger.kernel.org # v6.12+
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext.c