folio_precise_page_mapcount(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

okay so real talk, this one's from the kernel API manual and it's literally the vibe check for how many times a page got mapped 🫢


✨ NAME ✨

folio_precise_page_mapcount β€” the exact number of mappings of this folio page, no cap πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

int folio_precise_page_mapcount (struct folio *folio , struct page *page
);

🌸 ARGUMENTS 🌸

  • folio β€” the folio, bestie. that's the whole thing.
  • page β€” the page. yes queen, that one.

πŸ¦‹ DESCRIPTION πŸ¦‹

so it returns the number of present user page table entries that reference this page, as tracked via the RMAP β€” either referenced directly (PTE) or as part of a larger area that covers this page (e.g., PMD). it's giving precise. it's giving tracked. iykyk πŸ’…

use this function only for the calculation of existing statistics (USS, PSS, mapcount_max) and for debugging purposes (/proc/kpagecount).

and the big one, the line that matters most:

do not add new users. periodt. 🚫

like, this is not a "new feature" girlie, this is a "look at the existing numbers" girlie. do not come in here inventing a brand new caller, i'm begging 😭


πŸ‘‘ RETURN πŸ‘‘

the number of mappings of this folio page, purr πŸ’œ

and 0 for folios that are not mapped to user space or are not tracked via the RMAP (the example the manpage gives is the shared zeropage, iconic behaviour honestly).


🌈 SEE ALSO 🌈


✨ and that's the page!! source/version: ./fs/proc, dated October 2026 β€” stay mapped, stay tracked, and remember: statistics only, no new users, mwah πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from