From f92264b99c5fd3150c4f1ad65eff3f833038dc07 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 12 Sep 2024 10:06:50 +0100 Subject: [PATCH] mm/vmscan: Maintain TLB coherency in LRU code As a workaround (and possibly a fix) for CPU spins observed on BCM2837, use ptep_clear_flush_young instead of ptep_test_and_clear_young inside lru_gen_look_around in order to expose PTE changes to the MMU. Note that on architectures that don't require an explicit flush, ptep_clear_flush_young just calls ptep_test_and_clear_young. Signed-off-by: Phil Elwell --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 28ba2b06fc7dc2..faa0894e12e534 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4113,7 +4113,7 @@ bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw) if (!folio) continue; - if (!ptep_clear_young_notify(vma, addr, pte + i)) + if (!ptep_clear_flush_young_notify(vma, addr, pte + i)) continue; young++;