Skip to content

Commit

Permalink
mm/vmscan: Maintain TLB coherency in LRU code
Browse files Browse the repository at this point in the history
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 <phil@raspberrypi.com>
  • Loading branch information
pelwell committed Sep 13, 2024
1 parent 7a3d1c2 commit 08eb6b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -4736,7 +4736,7 @@ void lru_gen_look_around(struct page_vma_mapped_walk *pvmw)
if (!folio)
continue;

if (!ptep_test_and_clear_young(vma, addr, pte + i))
if (!ptep_clear_flush_young(vma, addr, pte + i))
VM_WARN_ON_ONCE(true);

young++;
Expand Down

0 comments on commit 08eb6b6

Please sign in to comment.