pcpu_alloc_alloc_info(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– pcpu_alloc_alloc_info πŸ’–

okay so bestie, welcome to the Kernel API Manual πŸŽ€ β€” this is the page for pcpu_alloc_alloc_info, and it's literally about allocating percpu allocation info. no cap, that's the whole vibe. let's get into it ✨


✨ SYNOPSIS ✨

struct pcpu_alloc_info * pcpu_alloc_alloc_info (int nr_groups , int nr_units );

that's the whole signature, character for character, don't come for me 🫢


🌸 ARGUMENTS 🌸

  • nr_groups β€” the number of groups. yes. that's it. that's the whole description πŸ’…
  • nr_units β€” the number of units. iconic of them to be so straightforward.

πŸ¦‹ DESCRIPTION πŸ¦‹

so what this does is allocate ai, and it makes ai big enough for nr_groups groups, each containing nr_units units. like it's sizing everything up for you, main character energy πŸ”₯

here's the tea: the returned ai's groups[0].cpu_map points to the cpu_map array β€” and that array is long enough for nr_units and is filled with NR_CPUS. yes, literally filled with NR_CPUS, all of it πŸ‘‘

⚠️ but listen β€” it is the caller's responsibility to initialize the cpu_map pointer of the other groups. not group 0. the other ones. don't forget, i'm begging you πŸ˜­πŸ™ˆ

⭐ RETURN ⭐

  • pointer to the allocated pcpu_alloc_info on success πŸ’–
  • NULL on failure πŸ’€

that's it. slay.


🧚 SEE ALSO 🧚

the kernel file is ./mm/percpu.c, and here's the full squad, all of them, in order, no cuts πŸ’œ:


and that's the page!! 🌈 this one's served fresh from ./mm, dated October 2026 β€” go read it again whenever you need it, i'll be right here πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from