free_pgd_range(9)
π 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β themmu_gatherthat'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, soaddris in,endis out. the way thatendis not included? iconic. π
π SEE ALSO π
kernel file ./mm/memory.c, plus this absolutely stacked cast of characters, all in section 9:
free_pgtables(9),__vm_normal_page(9),vm_normal_page(9)vm_normal_folio(9),vm_normal_page_pmd(9),vm_normal_folio_pmd(9)vm_normal_page_pud(9),restore_exclusive_pte(9),cond_install_uffd_wp_ptes(9)zap_vma_for_reaping(9),unmap_vmas(9),zap_vma_range_batched(9)zap_vma_range(9),zap_special_vma_range(9)vm_insert_pages(9),vm_insert_page(9),vm_map_pages(9),vm_map_pages_zero(9)vmf_insert_pfn_prot(9),vmf_insert_pfn(9),remap_pfn_range(9),vm_iomap_memory(9)__vmf_anon_prepare(9),finish_mkwrite_fault(9)unmap_mapping_folio(9),unmap_mapping_pages(9),unmap_mapping_range(9)set_pte_range(9),finish_fault(9),mm_account_fault(9)follow_pfnmap_start(9),follow_pfnmap_end(9),generic_access_phys(9)access_remote_vm(9),copy_remote_vm_str(9),folio_zero_user(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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms