]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched_ext: Make scx_bpf_dsq_insert*() return bool
authorTejun Heo <tj@kernel.org>
Tue, 7 Oct 2025 01:51:47 +0000 (15:51 -1000)
committerTejun Heo <tj@kernel.org>
Mon, 13 Oct 2025 18:49:29 +0000 (08:49 -1000)
commitcded46d971597ecfe505ba92a54253c0f5e1f2e4
tree8d0ea19e4d015795e801d03f24eab7973aa913e1
parentc0d630ba347c7671210e1bab3c79defea19844e9
sched_ext: Make scx_bpf_dsq_insert*() return bool

In preparation for hierarchical schedulers, change scx_bpf_dsq_insert() and
scx_bpf_dsq_insert_vtime() to return bool instead of void. With
sub-schedulers, there will be no reliable way to guarantee a task is still
owned by the sub-scheduler at insertion time (e.g., the task may have been
migrated to another scheduler). The bool return value will enable
sub-schedulers to detect and gracefully handle insertion failures.

For the root scheduler, insertion failures will continue to trigger scheduler
abort via scx_error(), so existing code doesn't need to check the return
value. Backward compatibility is maintained through compat wrappers.

Also update scx_bpf_dsq_move() documentation to clarify that it can return
false for sub-schedulers when @dsq_id points to a disallowed local DSQ.

Reviewed-by: Changwoo Min <changwoo@igalia.com>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext.c
tools/sched_ext/include/scx/common.bpf.h
tools/sched_ext/include/scx/compat.bpf.h