unmap_vmas(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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's struct mmu_gather, bestie. that's your caller's own gather struct, and yes, you're handing over its address πŸ’…
  • unmap β€” The unmap_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 πŸ’œ:


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