remove_vm_area(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 πŸŽ‰
  • NULL on 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:

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