folio_mapcount(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so bestie, welcome to the Kernel API Manual β€” this is folio_mapcount(9), and it's giving folio_mapcount β€” Number of mappings of this folio. ✨ Like, that's the name, that's the job, no cap. πŸ’…

🌸 SYNOPSIS 🌸

int folio_mapcount (const struct folio *folio );

That's the signature, character-for-character; the space before ); is staying, don't come for me. 😌

πŸ¦‹ ARGUMENTS πŸ¦‹

  • folio β€” the folio. That's the whole argument, bestie: the folio in question. 🫢

πŸ’œ DESCRIPTION πŸ’œ

Okay so the folio mapcount is literally the number of present user page table entries that reference any part of a folio. And each such present user page table entry must be paired with exactly on folio reference β€” yes, on, that's the page's wording, keep it. πŸ‘‘

For ordindary folios (that's the spelling on the page, bestie), each user page table entry (PTE/PMD/PUD/...) counts exactly once.

For hugetlb folios, each abstracted "hugetlb" user page table entry that references the entire folio counts exactly once, even when such special page table entries are comprised of multiple ordinary page table entries.

Will report 0 for pages which cannot be mapped into userspace, such as slab, page tables and similar. Zero, bestie. πŸ’€

πŸ”₯ RETURN πŸ”₯

The number of times this folio is mapped. That's the return value, vibe check passed, periodt. πŸ‘‘

🌈 SEE ALSO 🌈

Kernel file ./include/linux/mm.h β€” and here's the whole bestie squad, no skips:


source/version: ./include/linux Β· date: October 2026 β€” and yes, this whole thing is folio_mapcount(9), mwah πŸ’‹

πŸ“¦ where this page comes from