folio_average_page_mapcount(9)
okay so bestie, you're looking at folio_average_page_mapcount(9) from the Kernel API Manual β yes, that manual β and we're gonna get into it π
π NAME π
folio_average_page_mapcount β the average number of mappings per page in this folio. simple. iconic. no cap.
β¨ SYNOPSIS β¨
int folio_average_page_mapcount (struct folio *folio );
π¦ ARGUMENTS π¦
folioβ the folio. that's it. that's the argument, bestie.
πΈ DESCRIPTION πΈ
okay so here's the vibe: this gives you the average number of user page table entries that reference each page in this folio, as tracked via the RMAP. those entries are either referenced directly (PTE) or as part of a larger area that covers this page (e.g., PMD). yes, both flavors π«Ά
The average is calculated by rounding to the nearest integer. BUT β plot twist β to avoid duplicated code in current callers, the average is at least 1 if any page of the folio is mapped. so if any page is mapped, you're not getting a 0 here. periodt π
π RETURN π
The average number of mappings per page in this folio. that's the return value. that's the whole thing. slay β¨
π SEE ALSO π
- Kernel file
./fs/proc/internal.hβ the kernel file in question, go peek if you're nosy iykyk. folio_precise_page_mapcount(9)β the precise sibling, bestie. go say hi π
later bestie π«Ά this page lives under ./fs/proc and it's dated October 2026. 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