scx_bpf_nr_online_cids(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… scx_bpf_nr_online_cids(9) β€” from the Kernel API Manual, bestie πŸŽ€

okay so picture this: you're deep in the kernel API manual, section 9, and you hit this little icon. It's scx_bpf_nr_online_cids(9) and honestly? She's serving "one job, done well." Let's get into it ✨


🌸 NAME 🌸

scx_bpf_nr_online_cids β€” she returns the current count of online CPUs in cid space. That's it, that's the whole gig. Lowkey iconic for it πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

__bpf_kfunc u32 scx_bpf_nr_online_cids (void );

Look at her. No arguments, no drama, just vibes and a u32 🫢


πŸ“ ARGUMENTS πŸ“

  • void β€” no arguments. None. Zero. She takes nothing, she needs nothing, she's independent like that πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

So what does she actually do? She returns num_online_cpus. Simple, clean, no cap.

Now here's the lore you actually need, bestie. The standard model restarts the scheduler on hotplug, which is what lets schedulers treat the range [0, nr_online_cids) as the online range. Very "if it ain't broke" of them ngl.

But if your scheduler is a main character who wants to handle hotplug without a restart? Then you gotta do the extra work yourself:

  1. Install a custom mapping via scx_bpf_cid_override ✨
  2. Track onlining through the ops.cid_online / ops.cid_offline callbacks
  3. Start from the mask that scx_bpf_online_cmask returns πŸŽ€
no shortcuts on that path, bestie β€” it's a whole commitment. But hey, some of y'all love a project 🧚

πŸ”₯ SEE ALSO πŸ”₯

Bestie, the whole friend group showed up. Kernel file ./kernel/sched/ext/ext.c and then, in order:


and that's the whole page, bestie πŸ’œ go read your schedulers, hydrate, and remember: this icon lives in ./kernel/sched/ext and she was dated October 2026. mwah πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from