]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
mm: memcg: guard memcg1-specific members of struct mem_cgroup_per_node
authorRoman Gushchin <roman.gushchin@linux.dev>
Fri, 28 Jun 2024 21:03:15 +0000 (21:03 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 5 Jul 2024 01:05:57 +0000 (18:05 -0700)
Put memcg1-specific members of struct mem_cgroup_per_node under the
CONFIG_MEMCG_V1 config option.

Link: https://lkml.kernel.org/r/20240628210317.272856-8-roman.gushchin@linux.dev
Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
Acked-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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/memcontrol.h

index 107b0c5d6eab0efcc89a3c56964a29543c145556..c7ef628ee882490c2c9956df837493f458acffac 100644 (file)
@@ -92,6 +92,7 @@ struct mem_cgroup_per_node {
        struct lruvec_stats                     *lruvec_stats;
        struct shrinker_info __rcu      *shrinker_info;
 
+#ifdef CONFIG_MEMCG_V1
        /*
         * Memcg-v1 only stuff in middle as buffer between read mostly fields
         * and update often fields to avoid false sharing. Once v1 stuff is
@@ -102,6 +103,7 @@ struct mem_cgroup_per_node {
        unsigned long           usage_in_excess;/* Set to the value by which */
                                                /* the soft limit is exceeded*/
        bool                    on_tree;
+#endif
 
        /* Fields which get updated often at the end. */
        struct lruvec           lruvec;