pcpu_next_md_free_region(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– pcpu_next_md_free_region(9) πŸ’–

okay so this entire page is from the Kernel API Manual, and it’s here to explain one very specific little helper. It’s giving β€œdeep in the kernel group chat” energy, and honestly? iconic.


✨ NAME ✨

pcpu_next_md_free_region β€” finds the next hint free area 🎯


πŸŽ€ SYNOPSIS πŸŽ€

void pcpu_next_md_free_region (struct pcpu_chunk *chunk , int *bit_off ,
       int *bits );

🧚 ARGUMENTS 🧚

  • chunk β€” chunk of interest, bestie. That’s the chunk we’re looking at.
  • bit_off β€” chunk offset.
  • bits β€” size of free area.

πŸ’… DESCRIPTION πŸ’…

So this is a helper function for pcpu_for_each_md_free_region. No cap.

It checks block->contig_hint and performs aggregation across blocks to find the next hint. The way it does that is very β€œmain character energy”: it modifies bit_off and bits in-place to be consumed in the loop. ✨

In-place updates are the vibe here β€” bit_off and bits get changed right where they are, and that’s exactly what the loop expects. πŸ’–

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file: ./mm/percpu.c β€” plus the whole related squad below:


Source/version: ./mm Β· Date: October 2026 Β· Page: pcpu_next_md_free_region(9) β€” that’s the footer, bestie, and we ate πŸ’…πŸ’–

πŸ“¦ where this page comes from