group_cpus_evenly(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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:

  1. allocate present CPUs on these groups evenly first ⭐
  2. 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