1 From 25887d48dff860751a06caa4188bfaf6bfb6e4b2 Mon Sep 17 00:00:00 2001
2 From: Yu Zhao <yuzhao@google.com>
3 Date: Wed, 21 Dec 2022 21:19:06 -0700
4 Subject: [PATCH 08/19] UPSTREAM: mm: multi-gen LRU: simplify
5 arch_has_hw_pte_young() check
7 Scanning page tables when hardware does not set the accessed bit has
10 Link: https://lkml.kernel.org/r/20221222041905.2431096-9-yuzhao@google.com
11 Signed-off-by: Yu Zhao <yuzhao@google.com>
12 Cc: Johannes Weiner <hannes@cmpxchg.org>
13 Cc: Jonathan Corbet <corbet@lwn.net>
14 Cc: Michael Larabel <Michael@MichaelLarabel.com>
15 Cc: Michal Hocko <mhocko@kernel.org>
16 Cc: Mike Rapoport <rppt@kernel.org>
17 Cc: Roman Gushchin <roman.gushchin@linux.dev>
18 Cc: Suren Baghdasaryan <surenb@google.com>
19 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
21 (cherry picked from commit f386e9314025ea99dae639ed2032560a92081430)
22 Change-Id: I84d97ab665b4e3bb862a9bc7d72f50dea7191a6b
23 Signed-off-by: T.J. Mercier <tjmercier@google.com>
26 1 file changed, 1 insertion(+), 1 deletion(-)
28 diff --git a/mm/vmscan.c b/mm/vmscan.c
29 index 0a0e1250ffc87..aa9746f2bc80b 100644
32 @@ -4415,7 +4415,7 @@ static bool try_to_inc_max_seq(struct lruvec *lruvec, unsigned long max_seq,
33 * handful of PTEs. Spreading the work out over a period of time usually
34 * is less efficient, but it avoids bursty page faults.
36 - if (!force_scan && !(arch_has_hw_pte_young() && get_cap(LRU_GEN_MM_WALK))) {
37 + if (!arch_has_hw_pte_young() || !get_cap(LRU_GEN_MM_WALK)) {
38 success = iterate_mm_list_nowalk(lruvec, max_seq);