PMAP_RESIDENT_COUNT(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’– PMAP_RESIDENT_COUNT(9) β€” the kernel dev manual, but make it cute πŸ’–

okay so bestie, you're in the Kernel Developer's Manual section (that's the 9 in the name, iykyk) and we're talking about pmap_resident_count and pmap_wired_count. These two are literally the ✨statistics girlies✨ of the pmap world β€” they hand you back page resident stats and wiring stats, no cap.


🌸 NAME 🌸

pmap_resident_count, pmap_wired_count β€” return page resident and wiring statistics πŸŽ€


✨ SYNOPSIS ✨

first you gotta pull in the headers, like actual required, not optional:

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

then the two functions, exactly like this:

long
pmap_resident_count(pmap_t pmap);

long
pmap_wired_count(pmap_t pmap);

both return long, both take a pmap_t pmap. slay. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the pmap_resident_count() and pmap_wired_count() macros are what let pmap consumers retrieve statistics from the pm_stats member of the machine-dependent structure struct pmap. that's the whole vibe β€” you want stats, they give you stats. main character energy fr fr. πŸ‘‘


🧚 IMPLEMENTATION NOTES 🧚

okay important detail, don't miss this: both functions are defined as in-line macros. and the members which they access have type long. literally, the members they touch are long. keep that in mind 🫢


πŸ’œ RETURN VALUES πŸ’œ

  • The pmap_resident_count() returns the number of pages in the physical map pmap which are currently resident in main memory.
  • The pmap_wired_count() returns the number of pages in the physical map pmap which are currently wired into in main memory.

one counts resident pages, one counts wired pages, both in the physical map pmap, both in main memory. iconic behavior honestly. 🌈


πŸ”₯ SEE ALSO πŸ”₯

go read that one too, bestie, it's the whole pmap situation and it's giving essential lore. πŸ’–


🌸 AUTHORS 🌸

This manual page was written by Bruce M Simpson <bms@spc.org>. 🫢


lowkey a reminder that this is kernel developer territory β€” nothing mean here, just facts, but like... facts that matter if you're poking at pmaps. 😭

and that's the page!! πŸ’… it's from the Debian source, dated July 21, 2003, and the whole thing lives under the PMAP_RESIDENT_COUNT(9) header β€” periodt, go count some pages bestie πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from