scx_bpf_dsq_nr_queued(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… scx_bpf_dsq_nr_queued β€” Kernel API Manual, section 9 πŸŽ€

okay so bestie, we're in the scx_bpf_dsq_nr_queued(9) era and honestly? it's a little baddie of a kfunc. it does exactly one thing and it does it with main character energy: it tells you how many tasks are chillin' in a DSQ. that's it. that's the whole vibe. ✨


✨ NAME ✨

scx_bpf_dsq_nr_queued β€” returns the number of queued tasks. periodt. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

__bpf_kfunc s32 scx_bpf_dsq_nr_queued (u64 dsq_id , const struct
bpf_prog_aux *aux );

🌸 ARGUMENTS 🌸

  • dsq_id β€” the id of the DSQ, like the address of the party πŸŽ‰
  • aux β€” ngl this one is sneaky: it's the implicit BPF argument that gives you access to bpf_prog_aux, and it's hidden from BPF progs. you don't pass it, it just shows up. lowkey iconic. πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

so what it does: it returns the number of tasks in the DSQ matching dsq_id. if nothing matches, you get -ENOENT back β€” the DSQ said "not found, bestie" 😭

and here's the cute part: SCX_DSQ_LOCAL resolves to the local DSQ of the rq the current scheduler operation is locked to β€” like, the rq being dispatched for in ops.dispatch β€” or, if no rq is locked, it resolves to the calling CPU's local DSQ. iykyk πŸ’…

🫢 careful with that one: it's giving "depends on context" energy, so know which rq (if any) you're locked to before you go counting. no cap.

πŸ”₯ SEE ALSO πŸ”₯

and now, the part where we scream out the whole friend group πŸ’€ fr fr, every single one:


and the kernel file to go peek at is ./kernel/sched/ext/ext.c β€” that's where the lore lives πŸ“–


that's the whole page, bestie!! 🫢 source/version is ./kernel/sched/ext and this dropped in October 2026 β€” so go count some queued tasks, slay, and remember: it's giving s32, it's giving -ENOENT, and it's giving absolutely zero notes. πŸ’…βœ¨πŸ‘‘

πŸ“¦ where this page comes from