]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched_ext: Add SCX_OPS_ALWAYS_ENQ_IMMED ops flag
authorTejun Heo <tj@kernel.org>
Fri, 13 Mar 2026 19:43:23 +0000 (09:43 -1000)
committerTejun Heo <tj@kernel.org>
Fri, 13 Mar 2026 19:43:23 +0000 (09:43 -1000)
commit3229ac4a5ef5a838e82a784226432c92d3db90a8
treea20096623e11a5cbe5a8099acd212d4ce3830a3a
parent860683763ebf4662cb72a312279334e02718308f
sched_ext: Add SCX_OPS_ALWAYS_ENQ_IMMED ops flag

SCX_ENQ_IMMED makes enqueue to local DSQs succeed only if the task can start
running immediately. Otherwise, the task is re-enqueued through ops.enqueue().
This provides tighter control but requires specifying the flag on every
insertion.

Add SCX_OPS_ALWAYS_ENQ_IMMED ops flag. When set, SCX_ENQ_IMMED is
automatically applied to all local DSQ enqueues including through
scx_bpf_dsq_move_to_local().

scx_qmap is updated with -I option to test the feature and -F option for
IMMED stress testing which forces every Nth enqueue to a busy local DSQ.

v2: - Cover scx_bpf_dsq_move_to_local() path (now has enq_flags via ___v2).
    - scx_qmap: Remove sched_switch and cpu_release handlers (superseded by
      kernel-side wakeup_preempt_scx()). Add -F for IMMED stress testing.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
kernel/sched/ext.c
kernel/sched/ext_internal.h
tools/sched_ext/include/scx/compat.h
tools/sched_ext/scx_qmap.bpf.c
tools/sched_ext/scx_qmap.c