scx_cpu_to_cid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… scx_cpu_to_cid(9) β€” bestie's guide to the Kernel API Manual

okay so this is scx_cpu_to_cid, straight out of the kernel API manual (section 9, the good section), and honestly? it's giving "one job, does it well" πŸ’–


✨ NAME ✨

scx_cpu_to_cid β€” translate @cpu to its cid πŸ¦‹

like. that's it. that's the whole function. it takes a cpu and hands you its cid. no cap.


πŸŽ€ SYNOPSIS πŸŽ€

s32 scx_cpu_to_cid (struct scx_sched *sch , s32 cpu );

look at her. two params, returns an s32. iconic behavior fr fr πŸ‘‘


🌸 ARGUMENTS 🌸

  • sch β€” the scx_sched you pass in for error reporting 🫢 like, if something goes sideways, this is who gets the receipts.
  • cpu β€” the cpu to look up πŸ” the main character of this whole operation, ngl.

πŸ”₯ DESCRIPTION πŸ”₯

okay so the vibe here is simple: it returns the cid for cpu, or a negative errno on failure if it doesn't work out 😭

and listen β€” if you hand it an invalid cpu, it triggers scx_error on sch. so like, don't do that unless you want the drama πŸ’€ that's not me being mean, that's just the deal.

also: it uses the same usage rules as scx_cid_to_cpu, so if you already know that one you're literally set. iykyk πŸ’…


🌈 SEE ALSO 🌈

the whole squad, in the kernel file ./kernel/sched/ext/cid.h ✨

go read them, they're all slay, i promise πŸ§šπŸ’œ


ngl if you're passing a bad cpu in here just to see what happens: the scx_error on sch is coming for you πŸ™ˆ consider yourself warned, bestie.

and that's the whole page!! πŸŽ€ brought to you by ./kernel/sched/ext, dated October 2026 β€” mwah, love u, go write some scheduler code πŸ’–πŸ¦‹β­

πŸ“¦ where this page comes from