scx_bpf_get_idle_smtmask(9)
π scx_bpf_get_idle_smtmask β like, the whole manual page, bestie
Okay so real talk: this is scx_bpf_get_idle_smtmask(9) from the Kernel API Manual, and it's lowkey one of the cutest little kfuncs in the sched-ext universe. It hands you a referenced kptr to the idle-tracking, per-physical-core cpumask β which means you can actually check whether an entire physical core is free. Iconic behaviour, honestly. π¦
β¨ NAME β¨
scx_bpf_get_idle_smtmask β get a referenced kptr to the idle-tracking, per-physical-core cpumask. Can be used to determine if an entire physical core is free. π
β¨ SYNOPSIS β¨
__bpf_kfunc const struct cpumask * scx_bpf_get_idle_smtmask (const
struct bpf_prog_aux *aux );
β¨ ARGUMENTS β¨
auxβ the implicit BPF argument that gives you access tobpf_prog_aux. It's hidden from BPF progs, so likeβ¦ don't go looking for it, it's not for you bestie π
β¨ DESCRIPTION β¨
Returns an empty mask if idle tracking is not enabled, or if you're running on a UP kernel. That's the whole vibe check β no mask for you in those cases. π
fr fr, "empty mask" is a real answer here, not an error. Don't panic when you get nothing back, it's giving intentional. π
β¨ SEE ALSO β¨
Kernel file ./kernel/sched/ext/idle.c β plus the 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_node(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)
πΈ Okay that's the whole page, you ate that. Source/version lives at ./kernel/sched/ext, and this bad girl is dated October 2026 β scx_bpf_get_idle_smtmask(9), periodt. π
β¨
π¦ 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