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 β ifevais less thansva, 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
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms