unmap_vmas(9)
π unmap_vmas β a Kernel API Manual moment β¨
okay so bestie, welcome to the unmap_vmas page π this one lives in the Kernel API Manual, and it's giving "quiet but crucial" energy, iykyk.
πΈ NAME πΈ
unmap_vmas β unmap a range of memory covered by a list of vma's π
lowkey the whole personality in one line, no cap.
β¨ SYNOPSIS β¨
void unmap_vmas (struct mmu_gather *tlb , struct unmap_desc *unmap );
literally that's the whole call, and it returns void β she does the work and doesn't even ask for a thank-you π«Ά
π¦ ARGUMENTS π¦
tlbβ the address of the caller'sstruct mmu_gather, bestie. that's your caller's own gather struct, and yes, you're handing over its address πunmapβ Theunmap_desc. that's it, that's the whole description, she's mysterious like that π
π DESCRIPTION π
so the main character task: unmap all pages in the vma list. all of them. every single one π₯
but listen β only addresses between start and end will be unmapped. like, that's the boundary, respect it β
β important vibe check: the VMA list must be sorted in ascending virtual address order. not optional. not "eh, close enough." sorted. periodt π
and here's the part you cannot skip, bestie: unmap_vmas assumes that the caller will flush the whole unmapped address range after unmap_vmas returns. so the only responsibility here is to make sure that any thus-far unmapped pages are flushed before unmap_vmas drops the lock and schedules. that's the whole deal β don't leave those pages hanging, flush them first, then she drops the lock and schedules π§β¨
π SEE ALSO π
Kernel file ./mm/memory.c β and here's the full squad, no one left behind π:
free_pgd_range(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)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)
and that's the page, bestie π ty for reading, mwah π this gem came out of ./mm in October 2026 β catch you on the next one, slay πβ¨
π¦ 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