1ee766f8613faf3b991738ba8cc3e97d51d2271e
[openwrt/staging/wigyori.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 --- a/mm/vmscan.c
22 +++ b/mm/vmscan.c
23 @@ -6172,12 +6172,17 @@ void lru_gen_exit_memcg(struct mem_cgrou
24 int i;
25 int nid;
26
27 + VM_WARN_ON_ONCE(!list_empty(&memcg->mm_list.fifo));
28 +
29 for_each_node(nid) {
30 struct lruvec *lruvec = get_lruvec(memcg, nid);
31
32 + VM_WARN_ON_ONCE(lruvec->mm_state.nr_walkers);
33 VM_WARN_ON_ONCE(memchr_inv(lruvec->lrugen.nr_pages, 0,
34 sizeof(lruvec->lrugen.nr_pages)));
35
36 + lruvec->lrugen.list.next = LIST_POISON1;
37 +
38 for (i = 0; i < NR_BLOOM_FILTERS; i++) {
39 bitmap_free(lruvec->mm_state.filters[i]);
40 lruvec->mm_state.filters[i] = NULL;