pcpu_free_area(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pcpu_free_area(9) β€” Kernel API Manual, bestie edition

Okay so this is a page from the Kernel API Manual (section 9, the kernel-internals one, iykyk) and it's about pcpu_free_area β€” the little function that hands memory back to the percpu allocator. Let's get into it 🫢


✨ NAME ✨

pcpu_free_area β€” literally just frees the corresponding offset πŸ’€


🌸 SYNOPSIS 🌸

int pcpu_free_area (struct pcpu_chunk *chunk , int off );

πŸŽ€ ARGUMENTS πŸŽ€

  • chunk β€” the chunk of interest, aka the chunk you're obsessed with rn πŸ‘‘
  • off β€” addr offset into chunk, the exact spot inside it 🎯

πŸ¦‹ DESCRIPTION πŸ¦‹

So what does it actually do? Bestie, it figures out how big the allocation you're freeing is β€” using the boundary bitmap, bestie, the boundary bitmap β€” and then it clears the allocation map. That's it, that's the whole vibe. 🧹✨


⭐ RETURN ⭐

Number of freed bytes. That's the number it hands back to you, no cap πŸ’–


🌈 SEE ALSO 🌈

The kernel file ./mm/percpu.c, plus the whole percpu friend group β€” here's the full roster, nobody gets left out 🫢:


πŸ’‘ little note: pcpu_free_area lives in the ./mm source tree, and this page is dated October 2026. That's the tea πŸ“

Go free those offsets, bestie β€” you got this πŸ’…πŸ”₯

πŸ“¦ where this page comes from