group_cpus_evenly(9)
π group_cpus_evenly(9) π
okay so bestie, welcome to the group_cpus_evenly(9) page β yes that (9) is the manual section, it's giving kernel-API royalty π β and honestly this little function is lowkey iconic for what it does: grouping all your CPUs evenly per NUMA/CPU locality. no cap. π¦
β¨ NAME β¨
group_cpus_evenly β group all CPUs evenly per NUMA/CPU locality, fr fr π
πΈ SYNOPSIS πΈ
struct cpumask * group_cpus_evenly (unsigned int numgrps , unsigned int
*nummasks );
π ARGUMENTS π
numgrpsβ the number of groups. that's it, that's the whole vibe. πnummasksβ the number of initialized cpumasks. π§
β RETURN β
you get a cpumask array if it works β slay π
β and NULL otherwise π. and each element includes the CPUs assigned to this group, so every mask knows exactly who's in its squad π«Ά.
also: nummasks contains the number of initialized masks, which can be less than numgrps. yes, less. don't come for me, that's just how it is. π
π DESCRIPTION π
the whole mission here is to try to put close CPUs β close from the viewpoint of CPU and NUMA locality β into the same group π. and it does it with a two-stage grouping, main character energy only:
- allocate present CPUs on these groups evenly first β
- allocate other possible CPUs on these groups evenly β¨
and here's the guarantee, written in stone, no take-backs: in the resulted grouping, all CPUs are covered, and no same CPU is assigned to multiple groups. periodt. ππ₯
π¦ SEE ALSO π¦
- Kernel file
./lib/group_cpus.cβ go read the source, iykyk π
and that's the whole page bestie, mwah π β this cutie came from ./lib, dated October 2026, and it goes by group_cpus_evenly(9). take care of her ππΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms