scx_bpf_cid_to_cpu(9)
π NAME π
okay so bestie, welcome to scx_bpf_cid_to_cpu(9) from the Kernel API Manual, and the entire vibe is: Return the raw CPU id for @cid. That's the main character energy, fr fr. π«Άβ¨
β¨ SYNOPSIS β¨
__bpf_kfunc s32 scx_bpf_cid_to_cpu (s32 cid , const struct bpf_prog_aux
*aux );
πΈ ARGUMENTS πΈ
cidβ thecidto look up. That's the one you're asking about, bestie. πauxβ an implicit BPF argument to accessbpf_prog_auxhidden from BPF progs. It's giving backstage-pass energy, ngl. π
π¦ DESCRIPTION π¦
Okay so here's the tea: this returns the raw CPU id for cid. If cid is invalid, it triggers scx_error and returns -EINVAL. No cap. π
The cid<->cpu mapping is static for the lifetime of the loaded scheduler, so the BPF side can cache the result to avoid repeated kfunc invocations. That's literally the shortcut, and I'm obsessed. Slay. β¨
π₯ SEE ALSO π₯
Kernel file ./kernel/sched/ext/cid.c β and the whole friend group, iykyk:
scx_cid_publish_tables(9)scx_cid_retire_tables(9)scx_cid_init(9)scx_cmask_clear(9)scx_cmask_fill(9)scx_bpf_cid_override(9)scx_bpf_cpu_to_cid(9)scx_cmask_subset(9)scx_cmask_empty(9)scx_bpf_cid_topo(9)scx_cmask_ref_init(9)scx_cmask_ref_init_kern(9)scx_cmask_ref_shard(9)scx_cmask_ref_or(9)scx_cmask_ref_copy(9)scx_cmask_ref_from_cpumask(9)
byee bestie β source/version ./kernel/sched/ext, date October 2026. 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