vm_unmap_aliases(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… vm_unmap_aliases(9) β€” from the Kernel API Manual, bestie 🫢

Okay so bestie, gather round, because today we're talking about vm_unmap_aliases, a little function from the vmap layer that's lowkey doing the cleanup nobody wants to think about ✨


🌸 NAME 🌸

vm_unmap_aliases β€” unmaps all those outstanding lazy aliases chilling in the vmap layer, no cap πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

void vm_unmap_aliases (void );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • void β€” literally no arguments. zero. nada. she takes nothing and she gives you a clean slate 🫢

πŸ’– DESCRIPTION πŸ’–

So here's the tea β˜• β€” the vmap/vmalloc layer lazily flushes kernel virtual mappings, and the whole reason is to amortize TLB flushing overheads. Fancy word, iconic concept: instead of flushing all the time, she waits and batches it, because flushing constantly is expensive and nobody has the bandwidth for that 😭

What that actually means for you: any page you have right now may, in a former life, have been mapped into kernel virtual address by the vmap layer. So there might be some CPUs out there with TLB entries still referencing that page β€” extra ones, on top of the regular 1:1 kernel mapping πŸ‘€ it's giving "ghost of mappings past," honestly.

vm_unmap_aliases flushes all of those lazy mappings. All of them. Every last one πŸ’€

And after it returns? That's the moment. We can be sure that none of the pages we have control over will have any aliases from the vmap layer. Clean. Cleansed. Iconic. ✨

ngl bestie, this is one of those "trust the return, not the vibes" situations β€” the guarantee only kicks in after it returns, so don't be out here assuming anything before that, okay? πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./mm/vmalloc.c β€” and honestly, the whole friend group is here, so say hi πŸ‘‹


okay that's the whole page, mwah πŸ’‹ this one came out of <code>./mm</code> and it's dated <b>October 2026</b> β€” so when you're citing it, that's <code>vm_unmap_aliases(9)</code>, Kernel API Manual, October 2026, from <code>./mm</code>. go off, bestie, your TLB is gonna be so clean πŸŒˆπŸ’œ

πŸ“¦ where this page comes from