950-1261-mm-vmscan-Maintain-TLB-coherency-in-LRU-code.patch 957 B

123456789101112131415161718192021222324252627
  1. From 536f2097dc397e4ebd0566e8f00219c02d7c8073 Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <[email protected]>
  3. Date: Thu, 12 Sep 2024 10:06:50 +0100
  4. Subject: [PATCH 1261/1350] mm/vmscan: Maintain TLB coherency in LRU code
  5. As a workaround (and possibly a fix) for CPU spins observed on BCM2837,
  6. use ptep_clear_flush_young instead of ptep_test_and_clear_young inside
  7. lru_gen_look_around in order to expose PTE changes to the MMU. Note that
  8. on architectures that don't require an explicit flush,
  9. ptep_clear_flush_young just calls ptep_test_and_clear_young.
  10. Signed-off-by: Phil Elwell <[email protected]>
  11. ---
  12. mm/vmscan.c | 2 +-
  13. 1 file changed, 1 insertion(+), 1 deletion(-)
  14. --- a/mm/vmscan.c
  15. +++ b/mm/vmscan.c
  16. @@ -4723,7 +4723,7 @@ void lru_gen_look_around(struct page_vma
  17. if (!folio)
  18. continue;
  19. - if (!ptep_test_and_clear_young(vma, addr, pte + i))
  20. + if (!ptep_clear_flush_young(vma, addr, pte + i))
  21. VM_WARN_ON_ONCE(true);
  22. young++;