scx_cid_to_cpu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the scx_sched you're passing in so errors can be reported. It's giving "responsible adult in the group chat" energy. 🫢
  • cid β€” the cid you 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, and scx_error does not fire. Different vibe, same function. πŸŽ€

🌸 SEE ALSO

Kernel file ./kernel/sched/ext/cid.h and its iconic little friend group:

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