folio_precise_page_mapcount(9)
π 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 π
- Kernel file
./fs/proc/internal.h folio_average_page_mapcount(9)
β¨ 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms