PMAP_REMOVE(9)

πŸ’… PMAP_REMOVE β€” the section 9 kernel girlies' guide to yeeting pages out of a physical map πŸ’–

okay so bestie, welcome to PMAP_REMOVE(9), aka the Kernel Developer's Manual page that teaches you how to take pages OUT of a physical map. yes, literally. we're removing things. it's giving spring cleaning but for memory. 🧹✨


🌸 NAME 🌸

pmap_remove, pmap_remove_all, pmap_remove_pages β€” remove pages from a physical map πŸ—‘οΈ


✨ SYNOPSIS ✨

okay so first you gotta include the girlies:

#include <sys/param.h>
#include <vm/vm.h>
#include <vm/pmap.h>

then here's the trio, no cap:

void
pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva);

void
pmap_remove_all(vm_page_t m);

void
pmap_remove_pages(pmap_t pmap);

three functions, all returning void, all just doing the thing. main character energy fr fr. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

🌈 pmap_remove()

The pmap_remove() function removes the range of addresses between sva and eva from the physical map pmap. slice it out, gone, bye. πŸ’…

⚠️ but bestie, listen β€” if eva is less than sva, then the result is undefined. like, we don't know what happens. nobody knows. do not do this. 😭

Also it's assumed that both sva and eva are page-aligned addresses. that's the vibe, that's the expectation, that's the requirement. πŸŽ€

πŸŽ€ pmap_remove_all()

The pmap_remove_all() removes the physical page m from all physical maps in which it resides β€” every single one, she does not miss πŸ”₯ β€” and reflects back the modify bits to the appropriate pager. so polite of her honestly. ✨

πŸ’– pmap_remove_pages()

The pmap_remove_pages() function removes all user pages from the physical map pmap. she's the girl who clears the whole floor at once. 🧚

She gets called when a process exits, to run down its address space more quickly than would be the case for calling pmap_remove(). so like, it's the speedrun version. πŸƒβ™€οΈπŸ’¨ periodt.


πŸ‘€ SEE ALSO πŸ‘€


🫢 AUTHORS 🫢

This manual page was written by Bruce M Simpson <bms@spc.org>. absolute icon, we thank her. πŸ’œ


and that's the whole page bestie, slay πŸ’…βœ¨

this one came from Debian, dated July 21, 2003, and it lives at PMAP_REMOVE(9) in the Kernel Developer's Manual β€” mwah, go remove some pages responsibly πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from