remove_vm_area(9)
π remove_vm_area β find and remove a continuous kernel virtual area π
okay so welcome to remove_vm_area(9), from the Kernel API Manual π bestie, this one's short and sweet but there's a little trap in it that you need to know about, so stay with me π
β¨ SYNOPSIS β¨
struct vm_struct * remove_vm_area (const void *addr );
like, that's the whole vibe β you hand it an address, it hands you back a struct vm_struct *. simple. iconic. π¦
πΈ ARGUMENTS πΈ
addrβ the base address π«Ά that's it, that's the argument. the starting point of the area you're hunting for.
π₯ DESCRIPTION π₯
so what it does is: it searches for the kernel VM area that starts at addr, and removes it ππ yes, actually removes it, no take-backsies.
Then it returns the VM area it found β but here's the part where you gotta listen to me, bestie π:
It returns the found VM area, but using it is NOT safe on SMP machines, except for its size or flags.
like the ALL CAPS "NOT" is doing so much work there and it deserves it π. on SMP machines you can peep the size or the flags and that's it. nothing else. don't be out here dereferencing the rest of it, that's not the move. π«
β RETURN β
- the area descriptor on success π
NULLon failure π
slay either way, just check it, okay? π
π SEE ALSO π
okay this list is LONG, like it's giving "the whole vmalloc friend group" energy π the manual points you at kernel file ./mm/vmalloc.c and these, in exactly this order:
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_unmap_ram(9)vm_map_ram(9)vm_area_add_early(9)vm_area_register_early(9)get_vm_area(9)find_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)
go read all 35 of them, i believe in you π§β¨ (iykyk)
and that's the whole page, bestie!! π this one came out of ./mm and it's dated October 2026, so you know exactly which era of the kernel manual you're reading π bye, ily, go check your SMP safety π
β¨
π¦ 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