scx_cid_to_cpu(9)
π NAME
Okay bestie, welcome to scx_cid_to_cpu(9) β the kernel API manual page that's literally here to translate a @cid into its cpu. No cap, that's the whole vibe: scx_cid_to_cpu - Translate @cid to its cpu. β¨
β¨ SYNOPSIS
s32 scx_cid_to_cpu (struct scx_sched *sch , s32 cid );
π ARGUMENTS
schβ thescx_schedyou're passing in so errors can be reported. It's giving "responsible adult in the group chat" energy. π«Άcidβ thecidyou want to look up. The main character of this function, fr. π
π¦ DESCRIPTION
So here's the tea: this function returns the cpu for cid, or a negative errno if something goes off. π« An invalid cid triggers scx_error on sch β dramatic? maybe. Necessary? absolutely. π
The mapping is stable while the scheduler is live, so you can lowkey count on it during that window. β¨
And here's the niche but important part, bestie: it returns -EINVAL without triggering scx_error if no tables have been published yet. A prog-facing kfunc can observe that while racing the root scheduler enable β iykyk, timing is everything. π
No cap: if there are no published tables yet, you get-EINVAL, andscx_errordoes not fire. Different vibe, same function. π
πΈ SEE ALSO
Kernel file ./kernel/sched/ext/cid.h and its iconic little friend group:
cid_valid(9)__scx_cid_to_cpu(9)__scx_cpu_to_cid(9)scx_cpu_to_cid(9)scx_is_cid_type(9)__scx_cmask_init(9)scx_cmask_init(9)scx_cmask_reframe(9)scx_cmask_test(9)scx_cmask_for_each_cid(9)
They all ate, honestly. π
Sign-off time, bestie π β this lil masterpiece lives in ./kernel/sched/ext, dated October 2026, and it's literally scx_cid_to_cpu(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