020-v6.3-28-mm-multi-gen-LRU-simplify-arch_has_hw_pte_young-chec.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. From cf3297e4c7a928da8b2b2f0baff2f9c69ea57952 Mon Sep 17 00:00:00 2001
  2. From: Yu Zhao <[email protected]>
  3. Date: Wed, 21 Dec 2022 21:19:06 -0700
  4. Subject: [PATCH 28/29] mm: multi-gen LRU: simplify arch_has_hw_pte_young()
  5. check
  6. Scanning page tables when hardware does not set the accessed bit has
  7. no real use cases.
  8. Link: https://lkml.kernel.org/r/[email protected]
  9. Signed-off-by: Yu Zhao <[email protected]>
  10. Cc: Johannes Weiner <[email protected]>
  11. Cc: Jonathan Corbet <[email protected]>
  12. Cc: Michael Larabel <[email protected]>
  13. Cc: Michal Hocko <[email protected]>
  14. Cc: Mike Rapoport <[email protected]>
  15. Cc: Roman Gushchin <[email protected]>
  16. Cc: Suren Baghdasaryan <[email protected]>
  17. Signed-off-by: Andrew Morton <[email protected]>
  18. ---
  19. mm/vmscan.c | 2 +-
  20. 1 file changed, 1 insertion(+), 1 deletion(-)
  21. --- a/mm/vmscan.c
  22. +++ b/mm/vmscan.c
  23. @@ -4144,7 +4144,7 @@ static bool try_to_inc_max_seq(struct lr
  24. * handful of PTEs. Spreading the work out over a period of time usually
  25. * is less efficient, but it avoids bursty page faults.
  26. */
  27. - if (!force_scan && !(arch_has_hw_pte_young() && get_cap(LRU_GEN_MM_WALK))) {
  28. + if (!arch_has_hw_pte_young() || !get_cap(LRU_GEN_MM_WALK)) {
  29. success = iterate_mm_list_nowalk(lruvec, max_seq);
  30. goto done;
  31. }