scx_bpf_dsq_...o_local___v2(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… scx_bpf_dsq_...o_local___v2 β€” from the Kernel API Manual, section 9 πŸŽ€

okay bestie, so we're in the kernel API manual (section 9, the big-league function pages), and today's main character is scx_bpf_dsq_move_to_local___v2. say it three times fast, i dare you πŸ’€


✨ NAME ✨

scx_bpf_dsq_move_to_local___v2 β€” move a task from a DSQ to the current CPU's local DSQ πŸ¦‹


🌸 SYNOPSIS 🌸

__bpf_kfunc bool scx_bpf_dsq_move_to_local___v2 (u64 dsq_id , u64 enq_flags , const struct bpf_prog_aux *aux );

like, that's the whole signature, copy it exactly, no notes πŸ’–


πŸŽ€ ARGUMENTS πŸŽ€

  • dsq_id β€” the DSQ you're moving the task from. lowkey important: it must be a user-created DSQ. built-ins need not apply, we'll get to that πŸ™ˆ
  • enq_flags β€” the SCX_ENQ_* flags, applied when the task lands.
  • aux β€” the implicit BPF argument that gives access to bpf_prog_aux, and it's hidden from BPF progs. so like, not your business, the kernel handles it 🫢

πŸ”₯ DESCRIPTION πŸ”₯

so what it does: it moves a task from the non-local DSQ identified by dsq_id over to the current CPU's local DSQ for execution, with enq_flags applied. cute, right? ✨

the vibe check: it can only be called from ops.dispatch. that's the one and only place. no cap.

built-in DSQs (SCX_DSQ_GLOBAL and SCX_DSQ_LOCAL*) are not supported as sources β€” they simply don't get to sit at our table πŸ’… here's the tea:

  • Local DSQs do support reenqueueing (a task can be picked up for execution, dequeued for property changes, or reenqueued), 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 which makes the scope difficult to define. this may change in the future β€” so like, watch this space πŸ‘€

also, heads up, this function flushes the in-flight dispatches from scx_bpf_dsq_insert before it even tries to move from the specified DSQ. and it may also grab rq locks, which means it can't be called under any BPF locks 😭 fr fr don't do it.

returns: true if a task has been moved, false if there isn't any task to move. simple as that, periodt.


⭐ SEE ALSO ⭐

the kernel file is ./kernel/sched/ext/ext.c, and bestie, the friend group is huge. everyone showed up to the group chat πŸ‘‘


and that's the page, bestie 🌈 this one came from ./kernel/sched/ext, dated October 2026, and it lives in section 9 of the Kernel API Manual. go forth and dispatch responsibly, mwah πŸ’œπŸ§š

πŸ“¦ where this page comes from