scx_bpf_this_cid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… scx_bpf_this_cid(9) πŸ’…

okay so welcome to the Kernel API Manual bestie, we're doing scx_bpf_this_cid today and honestly? she's short, she's sweet, she's a whole vibe πŸŽ€


✨ NAME ✨

scx_bpf_this_cid β€” returns the cid of the CPU this program is running on πŸ‘‘ lowkey the most straightforward queen in the whole sched_ext lineup


🌸 SYNOPSIS 🌸

__bpf_kfunc s32 scx_bpf_this_cid (void );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • void β€” no arguments. nothing. zero. the void is voiding πŸ™ˆ she takes nothing and she gives you your cid, iconic behavior fr fr

πŸ’– DESCRIPTION πŸ’–

okay so basically this is the cid-addressed equivalent of bpf_get_smp_processor_id for scx programs ✨ like, same energy, different address system, iykyk

The current cpu is trivially valid β€” like obviously valid, no notes β€” so this whole thing is just a table lookup πŸ’… she's not doing gymnastics, she's just reading from the table bestie

⚠️ real talk though: she returns -EINVAL if you call her before any scheduler has ever published its cid tables. that's a hard no, not a soft no 😭 so like... make sure somebody published those tables first, mkay?

🫢 SEE ALSO 🫢

Kernel file ./kernel/sched/ext/ext.c β€” go read the source, she's right there 🧚

and literally the entire friend group omg there are so many of them, strap in:


that's the whole page bestie, short and slay πŸ’œ

🌈 sign-off era: this came out of ./kernel/sched/ext, dated October 2026 β€” that's the version/source + date, and yes i remembered them, no cap πŸ™ ✨ mwah, go call her responsibly πŸŽ€
πŸ“¦ where this page comes from