Re: [PATCH v5 8/9] mm: multi-gen LRU: Have secondary MMUs participate in aging

From: Sean Christopherson
Date: Wed Jun 12 2024 - 12:07:37 EST


On Tue, Jun 11, 2024, James Houghton wrote:
> diff --git a/mm/rmap.c b/mm/rmap.c
> index e8fc5ecb59b2..24a3ff639919 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -870,13 +870,10 @@ static bool folio_referenced_one(struct folio *folio,
> continue;
> }
>
> - if (pvmw.pte) {
> - if (lru_gen_enabled() &&
> - pte_young(ptep_get(pvmw.pte))) {
> - lru_gen_look_around(&pvmw);
> + if (lru_gen_enabled() && pvmw.pte) {
> + if (lru_gen_look_around(&pvmw))
> referenced++;
> - }
> -
> + } else if (pvmw.pte) {
> if (ptep_clear_flush_young_notify(vma, address,
> pvmw.pte))
> referenced++;

Random question not really related to KVM/secondary MMU participation. AFAICT,
the MGLRU approach doesn't flush TLBs after aging pages. How does MGLRU mitigate
false negatives on pxx_young() due to the CPU not setting Accessed bits because
of stale TLB entries?