zap_vma_for_reaping(9)
π zap_vma_for_reaping β kernel API manual, bestie edition π
okay so real talk, this one lives in the kernel API manual (section 9, the β¨iconicβ¨ one), and it's lowkey a whole mood: it yeets every single page table entry in a vma and it absolutely refuses to block while doing it. no cap. π€
β¨ NAME β¨
zap_vma_for_reaping β zap all page table entries in the vma without blocking π§Ήπ¨
πΈ SYNOPSIS πΈ
int zap_vma_for_reaping (struct vm_area_struct *vma );
π¦ ARGUMENTS π¦
vmaβ the vma to zap. that's it. that's the one. the main character of this whole operation π«Ά
π DESCRIPTION π
So what this does is, it zaps all page table entries in the vma β and the whole vibe is that it does it without blocking. Like, it's not gonna sit there and wait around, it's giving "i have places to be" energy. πββοΈπ¨
Who's it for? The oom killer. yes, that oom killer. the one who shows up when things are dire and starts making decisions. this function is basically the oom killer's little helper, so it can clear stuff out without getting stuck. πβ¨
β οΈ but listen β hugetlb vmas are not supported. not me showing up with a hugetlb vma and getting turned away π it's just not that girl, okay? don't try it.
β RETURN β
0β success, slay, we did it π-EBUSYβ if we would have to block. nope, not today. blocking is not the vibe, so you get-EBUSYinstead π
π SEE ALSO π
okay bestie, buckle up, because the friend group here is huge. all of these are from the kernel file ./mm/memory.c, iykyk:
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)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)
literally the whole group chat. tell them i said hi π
and that's the page, bestie β¨ this little cutie comes to you from the source tree at ./mm, and it's dated October 2026 β so yes, it's from the future, and yes, it's still serving looks π bye lovelies π
π«Ά
π¦ 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