folio_average_page_mapcount(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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