scx_bpf_get...smtmask_node(9)
π scx_bpf_get_idle_smtmask_node β from the Kernel API Manual, bestie
okay so picture this: it's giving kernel API, it's giving sched_ext, and the manual name is literally Kernel API Manual β so you already know we're in the cool part of the tree π§
β¨ NAME β¨
scx_bpf_get_idle_smtmask_node β grab a referenced kptr to the idle-tracking, per-physical-core cpumask of a target NUMA node. Basically: it tells you whether a whole physical core is free. Obsessed π«Ά
πΈ SYNOPSIS πΈ
__bpf_kfunc const struct cpumask * scx_bpf_get_idle_smtmask_node (s32 node , const struct bpf_prog_aux *aux );
π ARGUMENTS π
nodeβ the target NUMA node. that's the one, that's the node πauxβ an implicit BPF argument that gives you access tobpf_prog_aux, and it's hidden from BPF progs. so likeβ¦ it's there, you just don't see it π
π¦ DESCRIPTION π¦
So here's the vibe check: if idle tracking is not enabled, or if node is not valid, or if you're running on a UP kernel, this thing returns an empty cpumask. literally empty. no bits, no nothing π
and in that case, the actual error gets reported to the BPF scheduler via scx_error β so don't just sit there wondering, the scheduler gets told, periodt.
π SEE ALSO π
Kernel file ./kernel/sched/ext/idle.c, plus this whole friend group:
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(9)scx_bpf_put_idle_cpumask(9)scx_bpf_test_and_clear_cpu_idle(9)scx_bpf_pick_idle_cpu_node(9)scx_bpf_pick_idle_cpu(9)scx_bpf_pick_any_cpu_node(9)scx_bpf_pick_any_cpu(9)
β and that's the whole page, bestie β brought to you from ./kernel/sched/ext, dated October 2026, straight out of the Kernel API Manual. iykyk, now go pick some idle CPUs ππ
π¦ 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