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: Document why built-in DSQs are unsupported sources in scx_bpf_dsq_move_to_local()

Add a comment explaining the design intent behind rejecting built-in DSQs
(%SCX_DSQ_GLOBAL and %SCX_DSQ_LOCAL*) as sources. Local DSQs support
reenqueueing but the BPF scheduler cannot directly iterate or move tasks
from them. %SCX_DSQ_GLOBAL is similar but also doesn't support
reenqueueing because it maps to multiple per-node DSQs, making the scope
difficult to define.

Also annotate @dsq_id to make clear it must be a user-created DSQ.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Cheng-Yang Chou and committed by
Tejun Heo
238aa43f d6edb15a

+9 -1
+9 -1
kernel/sched/ext.c
··· 8212 8212 8213 8213 /** 8214 8214 * scx_bpf_dsq_move_to_local - move a task from a DSQ to the current CPU's local DSQ 8215 - * @dsq_id: DSQ to move task from 8215 + * @dsq_id: DSQ to move task from. Must be a user-created DSQ 8216 8216 * @aux: implicit BPF argument to access bpf_prog_aux hidden from BPF progs 8217 8217 * @enq_flags: %SCX_ENQ_* 8218 8218 * 8219 8219 * Move a task from the non-local DSQ identified by @dsq_id to the current CPU's 8220 8220 * local DSQ for execution with @enq_flags applied. Can only be called from 8221 8221 * ops.dispatch(). 8222 + * 8223 + * Built-in DSQs (%SCX_DSQ_GLOBAL and %SCX_DSQ_LOCAL*) are not supported as 8224 + * sources. Local DSQs support reenqueueing (a task can be picked up for 8225 + * execution, dequeued for property changes, or reenqueued), but the BPF 8226 + * scheduler cannot directly iterate or move tasks from them. %SCX_DSQ_GLOBAL 8227 + * is similar but also doesn't support reenqueueing, as it maps to multiple 8228 + * per-node DSQs making the scope difficult to define; this may change in the 8229 + * future. 8222 8230 * 8223 8231 * This function flushes the in-flight dispatches from scx_bpf_dsq_insert() 8224 8232 * before trying to move from the specified DSQ. It may also grab rq locks and