kernel: Update MGLRU patchset
[openwrt/staging/dedeckeh.git] / target / linux / generic / backport-5.15 / 020-v6.3-28-mm-multi-gen-LRU-simplify-arch_has_hw_pte_young-chec.patch
1 From cf3297e4c7a928da8b2b2f0baff2f9c69ea57952 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 28/29] mm: multi-gen LRU: simplify arch_has_hw_pte_young()
5 check
6
7 Scanning page tables when hardware does not set the accessed bit has
8 no real use cases.
9
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>
20 ---
21 mm/vmscan.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24 diff --git a/mm/vmscan.c b/mm/vmscan.c
25 index 4bcb93df316c..3f6874a69886 100644
26 --- a/mm/vmscan.c
27 +++ b/mm/vmscan.c
28 @@ -4144,7 +4144,7 @@ static bool try_to_inc_max_seq(struct lruvec *lruvec, unsigned long max_seq,
29 * handful of PTEs. Spreading the work out over a period of time usually
30 * is less efficient, but it avoids bursty page faults.
31 */
32 - if (!force_scan && !(arch_has_hw_pte_young() && get_cap(LRU_GEN_MM_WALK))) {
33 + if (!arch_has_hw_pte_young() || !get_cap(LRU_GEN_MM_WALK)) {
34 success = iterate_mm_list_nowalk(lruvec, max_seq);
35 goto done;
36 }
37 --
38 2.40.0
39