scx_bpf_cpu_curr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… scx_bpf_cpu_curr β€” like, the whole manual page, bestie

okay so this is scx_bpf_cpu_curr(9) from the Kernel API Manual, and it's genuinely one of the shorter ones so we can absolutely get through this together 🫢


✨ NAME ✨

scx_bpf_cpu_curr β€” grab the curr task of a remote CPU πŸ‘€ like you're peeking at somebody else's runqueue, respectfully.


✨ SYNOPSIS ✨

__bpf_kfunc struct task_struct * scx_bpf_cpu_curr (s32 cpu , const
struct bpf_prog_aux *aux );

literally one function, two args, returns a struct task_struct *. slay. πŸŽ€


✨ ARGUMENTS ✨

  • cpu β€” the CPU of interest πŸ’– the one you're being nosy about (it's an s32, yes, a signed 32-bit int, no I will not elaborate further).
  • aux β€” the implicit BPF argument that gives you access to bpf_prog_aux. and bestie, listen: this one is hidden from BPF progs. you don't pass it yourself, it just shows up like a plus-one you didn't invite πŸ™ˆ

✨ DESCRIPTION ✨

So here's the one (1) thing this page actually tells you, and it's a big one:

Callers must hold the RCU read lock (KF_RCU). no cap. like, actually. hold it. πŸ”’

that's the vibe. that's the requirement. KF_RCU is the flag situation, and if you're not holding the RCU read lock when you call this, that's not a "teehee oops" moment, that's a whole problem. the kernel will not be sending you a cute little warning first πŸ’€

so like β€” lock first, then call. in that order. main character energy requires reading the requirements, okay? πŸ‘‘


✨ SEE ALSO ✨

the kernel file lives at ./kernel/sched/ext/ext.c and honestly the friend group here is huge, so buckle up πŸ¦‹ here's everybody:


that's the whole page, no notes, you ate that πŸ“βœ¨

kisses, and remember the RCU read lock πŸ’œ

β€” this cutie lives in ./kernel/sched/ext, dated October 2026, and belongs to the scx_bpf_cpu_curr(9) era of the Kernel API Manual. periodt. πŸ’…πŸ‘‘

πŸ“¦ where this page comes from