free_pgd_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… free_pgd_range(9) β€” kernel API manual, bestie edition πŸŽ€

okay so real talk: this one lives in the kernel API manual, section 9, and it's genuinely one of those "quiet but crucial" little functions. no cap.


✨ NAME ✨

free_pgd_range β€” literally unmaps and frees page tables across a range. that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

void free_pgd_range (struct mmu_gather *tlb , unsigned long addr ,
       unsigned long end , unsigned long floor , unsigned long ceiling );

like yes she takes five args and returns nothing, she's a void icon, we stan. πŸ‘‘


πŸ’– ARGUMENTS πŸ’–

  • tlb β€” the mmu_gather that's holding onto all the pending TLB flush info. she's the bag, she's carrying the receipts. πŸ‘œ
  • addr β€” virtual address start. where the party begins.
  • end β€” virtual address end. where the party stops (exclusive-ish energy, see below).
  • floor β€” lowest address boundary. the floor, literally, don't go below it. 🧚
  • ceiling β€” highest address boundary. look up. that's the limit. ✨

πŸŽ€ DESCRIPTION πŸŽ€

so what does she actually do? this function tears down all the user-level page tables sitting inside the virtual address range [addr..end). all of them. not a vibe check, an actual teardown. πŸ’€

she's part of the memory unmap flow β€” like, the whole "we're getting rid of this memory, tidy up the page tables behind us" machine. 🧹

note the range is [addr..end) β€” that's half-open, so addr is in, end is out. the way that end is not included? iconic. πŸ™ˆ

🌈 SEE ALSO 🌈

kernel file ./mm/memory.c, plus this absolutely stacked cast of characters, all in section 9:

iykyk. go read them all, bestie, they're all in ./mm/memory.c territory. 🫢


okay that's the whole page!! this cutie ships from source ./mm, dated October 2026, and she lives in the Kernel API Manual, section 9. mwah, go free some page tables responsibly πŸ’œβ­πŸ“

πŸ“¦ where this page comes from