]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/sched_ext: Add tests for SCX_ENQ_IMMED and scx_bpf_dsq_reenq()
authorzhidao su <suzhidao@xiaomi.com>
Sun, 22 Mar 2026 07:35:33 +0000 (15:35 +0800)
committerTejun Heo <tj@kernel.org>
Mon, 23 Mar 2026 00:29:42 +0000 (14:29 -1000)
commitc50dcf533149e313a61d483769eb48682a1b0cdd
treea9564638429cef725bf39c47339f1d70add259e6
parent76edc2761ab8bd27fe4c4b8b2fb71baefc4a31e8
selftests/sched_ext: Add tests for SCX_ENQ_IMMED and scx_bpf_dsq_reenq()

Add three selftests covering features introduced in v7.1:

- dsq_reenq: Verify scx_bpf_dsq_reenq() on user DSQs triggers
  ops.enqueue() with SCX_ENQ_REENQ and SCX_TASK_REENQ_KFUNC in
  p->scx.flags.

- enq_immed: Verify SCX_OPS_ALWAYS_ENQ_IMMED slow path where tasks
  dispatched to a busy CPU's local DSQ are re-enqueued through
  ops.enqueue() with SCX_TASK_REENQ_IMMED.

- consume_immed: Verify SCX_ENQ_IMMED via the consume path using
  scx_bpf_dsq_move_to_local___v2() with explicit SCX_ENQ_IMMED.

All three tests skip gracefully on kernels that predate the required
features by checking availability via __COMPAT_has_ksym() /
__COMPAT_read_enum() before loading.

Signed-off-by: zhidao su <suzhidao@xiaomi.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/testing/selftests/sched_ext/Makefile
tools/testing/selftests/sched_ext/consume_immed.bpf.c [new file with mode: 0644]
tools/testing/selftests/sched_ext/consume_immed.c [new file with mode: 0644]
tools/testing/selftests/sched_ext/dsq_reenq.bpf.c [new file with mode: 0644]
tools/testing/selftests/sched_ext/dsq_reenq.c [new file with mode: 0644]
tools/testing/selftests/sched_ext/enq_immed.bpf.c [new file with mode: 0644]
tools/testing/selftests/sched_ext/enq_immed.c [new file with mode: 0644]