scx_bpf_pick_idle_cpu_node(9)
π 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β yourSCX_PICK_IDLE_*flags, the little toggles that change the vibe checkauxβ an implicit BPF argument so you can accessbpf_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 ifops.update_idleis implemented andSCX_OPS_KEEP_BUILTIN_IDLEis not set, or ifSCX_OPS_BUILTIN_IDLE_PER_NODEis not set. like, it's not being difficult, those are just the rules bestie π
π SEE ALSO π
- Kernel file
./kernel/sched/ext/idle.cβ the source, the mothership π§ scx_bpf_cpu_node(9)scx_bpf_select_cpu_dfl(9)__scx_bpf_select_cpu_and(9)scx_bpf_get_idle_cpumask_node(9)scx_bpf_get_idle_cpumask(9)scx_bpf_get_idle_smtmask_node(9)scx_bpf_get_idle_smtmask(9)scx_bpf_put_idle_cpumask(9)scx_bpf_test_and_clear_cpu_idle(9)scx_bpf_pick_idle_cpu(9)scx_bpf_pick_any_cpu_node(9)scx_bpf_pick_any_cpu(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms