zap_vma_range_batched(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

okay so this is a page from the Kernel API Manual and honestly? she's a baddie. sit down, grab a strawberry drink πŸ“, and let's talk about zap_vma_range_batched β€” the girl who literally deletes page table entries in a vma range for a living. no cap.


✨ SYNOPSIS ✨

void zap_vma_range_batched (struct mmu_gather *tlb , struct
       vm_area_struct *vma , unsigned long address , unsigned long size ,
       struct zap_details *details );

look at her. five arguments, returns nothing, causes chaos. main character energy fr πŸ’…


🌸 ARGUMENTS 🌸

  • tlb β€” pointer to the caller's struct mmu_gather. yes bestie, yours, she's just borrowing it 🫢
  • vma β€” the vma covering the range to zap. the neighborhood she's about to redecorate
  • address β€” starting address of the range to zap. where the demolition starts πŸ“
  • size β€” number of bytes to zap. how much she's taking out. iconic, honestly
  • details β€” details specifying zapping behavior. the vibe check parameters 🌈

πŸ’– DESCRIPTION πŸ’–

Okay so first thing first: tlb must not be NULL. that's not a suggestion, that's the law. no NULL tlb, periodt. 🚫

And the provided address range must be fully contained within vma β€” like, the whole range, inside the vma, no overhang, no sneaking out the sides. she is not flexible about this. πŸ™ˆ

Now the fun part: if vma is for hugetlb, tlb is flushed and re-initialized by this function. so she doesn't just use your tlb, she resets it. rebuild era. πŸ”₯

And if details is NULL? this function will zap all page table entries. all of them. every single one. she's not picky, she's thorough. πŸ’€


πŸ¦‹ SEE ALSO πŸ¦‹

squad goals, all of them, in exactly this order, no substitutions 😀

Kernel file ./mm/memory.c β€” 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), unmap_vmas(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)

like, that's the whole group chat. πŸ’œ


quick reminder bestie: NULL tlb = not allowed, range outside vma = not allowed. she will not be nice about it. 🧚

and that's the page!! brought to you by ./mm, October 2026 edition β€” mwah, love u, go zap responsibly πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from