scx_bpf_nr_cpu_ids(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– scx_bpf_nr_cpu_ids (9) β€” Kernel API Manual ✨

okay so bestie, this is a page from the Kernel API Manual, and it's about a tiny little kfunc that hands you back a number. That's it. That's the whole vibe. But it's a very important number, so let's get into it 🫢


🌸 NAME 🌸

scx_bpf_nr_cpu_ids β€” returns the number of possible CPU IDs, no cap πŸ’…


⭐ SYNOPSIS ⭐

__bpf_kfunc u32 scx_bpf_nr_cpu_ids (void );

look at that signature, it's giving "I take nothing, I give you a u32" πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • void β€” literally no arguments. zero. nada. she works alone, main character energy fr fr πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the whole tea: every valid CPU ID in the system is smaller than the value this thing returns. so if you're looping over CPUs and you wanna know where to stop, this is your girl ✨

that's the entire description. short, sweet, and honestly iconic for it πŸ’œ

bestie note: it says smaller than, not smaller than or equal to. don't come for me, I'm just reading the page 😭

πŸ”₯ SEE ALSO πŸ”₯

she's not alone in this kernel file! the page points at ./kernel/sched/ext/ext.c and then a huge friend group, so let's do a roll call πŸ‘‘

like, ninety whole entries. she has so many mutuals, it's honestly aspirational 🌈


and that's the whole page, bestie! πŸŽ€ this cutie lives in ./kernel/sched/ext, dated October 2026, and it's filed right there in the Kernel API Manual with header scx_bpf_nr_cpu_ids(9). go forth and loop over your CPUs correctly βœ¨πŸ’–

πŸ“¦ where this page comes from