PMAP_PAGE_EXISTS_QUICK(9)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1, nixpkgs unstable

πŸ’… PMAP_PAGE_EXISTS_QUICK

okay so bestie, welcome to PMAP_PAGE_EXISTS_QUICK(9) β€” that's the Kernel Developer's Manual page, section 9, and it's about exactly one tiny little function that does one tiny little job, and honestly? it eats. ✨


🌸 NAME 🌸

pmap_page_exists_quick β€” determine if a page exists in a physical map

like, is this page in this pmap or not, and can we find out fast πŸƒβ€β™€οΈπŸ’¨


πŸŽ€ SYNOPSIS πŸŽ€

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

bool
pmap_page_exists_quick(pmap_t pmap, vm_page_t m);

yes you need all three includes, no you cannot skip one, i don't make the rules (the kernel makes the rules) 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so the pmap_page_exists_quick() function is used to quickly determine if the page m exists in the physical map pmap. it's typically called from the VM paging code. that's it. that's the whole vibe check. πŸ’…

speed is the whole point here β€” the "quick" is literally in the name, it's giving main character energy πŸ”₯


πŸ‘‘ IMPLEMENTATION NOTES πŸ‘‘

the PV count used above may be changed upwards or downwards in future; it is only necessary that true be returned for a small subset of pmaps for proper page aging.

ngl this is the important bit so pay attention πŸ™ˆ β€” that "above" is the 16 from RETURN VALUES down there, and it is not a promise. it can go up, it can go down, it can do whatever it wants in the future. the only thing that actually has to hold is that true comes back for a small subset of pmaps, because that's what proper page aging needs. so don't go building your whole life on the number 16, bestie, it's not that kind of number 😭


⭐ RETURN VALUES ⭐

pmap_page_exists_quick() returns true only if the PV entry for the physical map pmap is one of the first 16 PVs linked from the page m. 🎯

that's it. that's the whole return contract. true under those conditions, and that's the only way you get a true. periodt. πŸ’€


🌈 SEE ALSO 🌈

go read that one next, iykyk 🧚


πŸ’– AUTHORS πŸ’–

this manual page was written by Bruce M Simpson <bms@spc.org>. thank you bruce, icon behavior πŸ‘‘


and that's a wrap on PMAP_PAGE_EXISTS_QUICK(9)! this one came from the Debian crew, dated July 21, 2003 β€” a vintage page serving vintage looks, and it still slays πŸ’…βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ«Ά

πŸ“¦ where this page comes from