1f3f8ffe6da8451ef59a0b6a69a15164f2c116c4
[openwrt/staging/jow.git] /
1 From bec433f29537652ed054148edfd7e2183ddcf7c3 Mon Sep 17 00:00:00 2001
2 From: "T.J. Alumbaugh" <talumbau@google.com>
3 Date: Wed, 18 Jan 2023 00:18:25 +0000
4 Subject: [PATCH 16/19] UPSTREAM: mm: multi-gen LRU: improve
5 lru_gen_exit_memcg()
6
7 Add warnings and poison ->next.
8
9 Link: https://lkml.kernel.org/r/20230118001827.1040870-6-talumbau@google.com
10 Change-Id: I53de9e04c1ae941e122b33cd45d2bbb5f34aae0c
11 Signed-off-by: T.J. Alumbaugh <talumbau@google.com>
12 Cc: Yu Zhao <yuzhao@google.com>
13 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
14 (cherry picked from commit 37cc99979d04cca677c0ad5c0acd1149ec165d1b)
15 Bug: 274865848
16 Signed-off-by: T.J. Mercier <tjmercier@google.com>
17 ---
18 mm/vmscan.c | 5 +++++
19 1 file changed, 5 insertions(+)
20
21 diff --git a/mm/vmscan.c b/mm/vmscan.c
22 index ccde215c084ca..d5d6f8d94f58a 100644
23 --- a/mm/vmscan.c
24 +++ b/mm/vmscan.c
25 @@ -6160,12 +6160,17 @@ void lru_gen_exit_memcg(struct mem_cgroup *memcg)
26 int i;
27 int nid;
28
29 + VM_WARN_ON_ONCE(!list_empty(&memcg->mm_list.fifo));
30 +
31 for_each_node(nid) {
32 struct lruvec *lruvec = get_lruvec(memcg, nid);
33
34 + VM_WARN_ON_ONCE(lruvec->mm_state.nr_walkers);
35 VM_WARN_ON_ONCE(memchr_inv(lruvec->lrugen.nr_pages, 0,
36 sizeof(lruvec->lrugen.nr_pages)));
37
38 + lruvec->lrugen.list.next = LIST_POISON1;
39 +
40 for (i = 0; i < NR_BLOOM_FILTERS; i++) {
41 bitmap_free(lruvec->mm_state.filters[i]);
42 lruvec->mm_state.filters[i] = NULL;
43 --
44 2.40.1
45