vm_unmap_ram(9)
π vm_unmap_ram β bestie's guide to putting that address space back
okay so real talk, this is a page from the Kernel API Manual (section 9, the kernel-API girlies) and it's about vm_unmap_ram. that's it. that's the whole vibe. let's get into it π
β¨ NAME β¨
vm_unmap_ram β unmap the linear kernel address space that got set up by vm_map_ram. yes bestie, it's the undo button π«Ά
πΈ SYNOPSIS πΈ
void vm_unmap_ram (const void *mem , unsigned int count );
that's the whole signature, no cap. it returns void β nothing comes back, it just does the thing π
π¦ ARGUMENTS π¦
memβ the pointer thatvm_map_ramhanded you. like, the exact one. don't get cute with it.countβ the count you passed to thatvm_map_ramcall. and listen: it cannot unmap partial π so if you mapped 8 and you're trying to unmap 3, that's not a thing, the whole mapping goes or nothing goes. periodt.
β SEE ALSO β
bestie this list is long but every single one is here, i'm not skipping a single crumb π
- the kernel file
./mm/vmalloc.c(the source of truth, the main character) vunmap_range(9)vmap_pages_range(9)vm_area_map_pages(9)vm_area_unmap_pages(9)new_vmap_block(9)vm_unmap_aliases(9)vm_map_ram(9)β the one that started it all, the prequel πvm_area_add_early(9)vm_area_register_early(9)get_vm_area(9)find_vm_area(9)remove_vm_area(9)vfree_atomic(9)vfree(9)vunmap(9)vmap(9)vmap_pfn(9)__vmalloc_node_range(9)__vmalloc_node(9)vmalloc(9)vmalloc_huge_node(9)vzalloc(9)vmalloc_user(9)vmalloc_node(9)vzalloc_node(9)vrealloc_node_align(9)vmalloc_32(9)vmalloc_32_user(9)vread_iter(9)remap_vmalloc_range_partial(9)remap_vmalloc_range(9)pvm_find_va_enclose_addr(9)pvm_determine_end_from_reverse(9)pcpu_get_vm_areas(9)pcpu_free_vm_areas(9)
like i said. a whole squad. iykyk π
β οΈ tiny but important vibe check:counthas to match what you gavevm_map_ram, because partial unmapping is simply not on the menu. be normal about it.
and that's the page, bestie!! written up all cute from the ./mm corner of the kernel tree, dated October 2026 β go unmap responsibly, mwah πβ¨
π¦ 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