]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
memcg: make PGPGIN and PGPGOUT v1 only
authorShakeel Butt <shakeel.butt@linux.dev>
Thu, 15 Aug 2024 05:04:53 +0000 (22:04 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 17 Aug 2024 00:53:24 +0000 (17:53 -0700)
Currently PGPGIN and PGPGOUT are used and exposed in the memcg v1 only
code.  So, let's put them under CONFIG_MEMCG_V1.

Link: https://lkml.kernel.org/r/20240815050453.1298138-8-shakeel.butt@linux.dev
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: T.J. Mercier <tjmercier@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c

index 75db39613569bef507b5e4a1080b6e3517e98f3c..001803c132048bb52ed790760ca04b57641ee1bc 100644 (file)
@@ -414,8 +414,10 @@ unsigned long lruvec_page_state_local(struct lruvec *lruvec,
 
 /* Subset of vm_event_item to report for memcg event stats */
 static const unsigned int memcg_vm_event_stat[] = {
+#ifdef CONFIG_MEMCG_V1
        PGPGIN,
        PGPGOUT,
+#endif
        PGSCAN_KSWAPD,
        PGSCAN_DIRECT,
        PGSCAN_KHUGEPAGED,
@@ -1474,10 +1476,11 @@ static void memcg_stat_format(struct mem_cgroup *memcg, struct seq_buf *s)
                       memcg_events(memcg, PGSTEAL_KHUGEPAGED));
 
        for (i = 0; i < ARRAY_SIZE(memcg_vm_event_stat); i++) {
+#ifdef CONFIG_MEMCG_V1
                if (memcg_vm_event_stat[i] == PGPGIN ||
                    memcg_vm_event_stat[i] == PGPGOUT)
                        continue;
-
+#endif
                seq_buf_printf(s, "%s %lu\n",
                               vm_event_name(memcg_vm_event_stat[i]),
                               memcg_events(memcg, memcg_vm_event_stat[i]));