On 25.01.23 23:09, Vishal Moola wrote:[..]
The issue is that we're not estimating the mapcount of the folio, so the name is very misleading ... I think you really want to avoid the term mapcount completely in that context. We're just using the #mappings of the first subpage to determine something differently.
Thinking about it, I guess "folio_estimated_sharers()" might be what we actually want to name it. Then you can comment how we estimate sharers by looking at into how many page tables the first subpage is currently mapped, and assume the same holds true for the other subpages.
It's unreliable because other subpages might behave differently, we might not be holding the pagelock to stabilize, and we're not looking at indirect mappings via the swapcache. But it's a comapratively good estimate for most scenarios I guess.