scx_bpf_cid_to_cpu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, welcome to scx_bpf_cid_to_cpu(9) from the Kernel API Manual, and the entire vibe is: Return the raw CPU id for @cid. That's the main character energy, fr fr. 🫢✨


✨ SYNOPSIS ✨

       __bpf_kfunc s32 scx_bpf_cid_to_cpu (s32 cid , const struct bpf_prog_aux
       *aux );

🌸 ARGUMENTS 🌸

  • cid β€” the cid to look up. That's the one you're asking about, bestie. πŸ”
  • aux β€” an implicit BPF argument to access bpf_prog_aux hidden from BPF progs. It's giving backstage-pass energy, ngl. πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea: this returns the raw CPU id for cid. If cid is invalid, it triggers scx_error and returns -EINVAL. No cap. πŸ’…

The cid<->cpu mapping is static for the lifetime of the loaded scheduler, so the BPF side can cache the result to avoid repeated kfunc invocations. That's literally the shortcut, and I'm obsessed. Slay. ✨

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./kernel/sched/ext/cid.c β€” and the whole friend group, iykyk:

byee bestie β€” source/version ./kernel/sched/ext, date October 2026. Periodt. πŸ’…πŸŽ€

πŸ“¦ where this page comes from