scx_cpu_to_cid(9)
π 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β thescx_schedyou 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 β¨
cid_valid(9)__scx_cid_to_cpu(9)__scx_cpu_to_cid(9)scx_cid_to_cpu(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)
go read them, they're all slay, i promise π§π
ngl if you're passing a badcpuin here just to see what happens: thescx_erroronschis 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
- 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