scx_bpf_pick_idle_cpu_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… scx_bpf_pick_idle_cpu_node(9) β€” like, the kernel API manual bestie πŸŽ€

okay so real talk, this is a page straight out of the Kernel API Manual and it's all about scx_bpf_pick_idle_cpu_node β€” a kfunc that goes and finds you a sleepy little cpu and claims it for you. no cap. ✨


🌸 NAME 🌸

scx_bpf_pick_idle_cpu_node β€” pick and claim an idle cpu from @node fr fr πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

__bpf_kfunc s32 scx_bpf_pick_idle_cpu_node (const struct cpumask
       *cpus_allowed , s32 node , u64 flags , const struct bpf_prog_aux *aux );

✨ ARGUMENTS ✨

  • cpus_allowed β€” the allowed cpumask, aka the guest list of cpus you're allowed to look at πŸ’…
  • node β€” the target NUMA node, like which neighborhood you're shopping in 🏘️
  • flags β€” your SCX_PICK_IDLE_* flags, the little toggles that change the vibe check
  • aux β€” an implicit BPF argument so you can access bpf_prog_aux, hidden from BPF progs πŸ™ˆ (not me, not you, it's just not for us)

πŸ‘‘ DESCRIPTION πŸ‘‘

Pick and claim an idle cpu in cpus_allowed from the NUMA node node. that's it, that's the whole thing πŸ’–

Returns the picked idle cpu number on success, or -EBUSY if no matching cpu was found. 😭 so if it comes back with -EBUSY it's literally telling you "ma'am, there is nothing here".

The search starts from node and proceeds to other online NUMA nodes in order of increasing distance (unless SCX_PICK_IDLE_IN_NODE is specified, in which case the search is limited to the target node). so it'll wander further out, closest spots first, unless you pin it down with SCX_PICK_IDLE_IN_NODE β€” then it stays exactly where you told it to. πŸŽ€

⚠️ Always returns an error if ops.update_idle is implemented and SCX_OPS_KEEP_BUILTIN_IDLE is not set, or if SCX_OPS_BUILTIN_IDLE_PER_NODE is not set. like, it's not being difficult, those are just the rules bestie πŸ’€

🌈 SEE ALSO 🌈


that's the whole page, and honestly? she ate. πŸ’…βœ¨ this one lives over at ./kernel/sched/ext, dated October 2026, and the title card reads scx_bpf_pick_idle_cpu_node(9) β€” slay, go pick yourself an idle cpu, you got this πŸ«ΆπŸ’–πŸ”₯

πŸ“¦ where this page comes from