summaryrefslogtreecommitdiff
path: root/mm/memcontrol-v1.h
diff options
context:
space:
mode:
authorRoman Gushchin <roman.gushchin@linux.dev>2024-06-29 00:03:12 +0300
committerAndrew Morton <akpm@linux-foundation.org>2024-07-05 04:05:56 +0300
commitb5855a26dedf210bcc1deb4cb30f9f657571a28a (patch)
tree4dab01c3d7985ceaafefc09b48b0e80cab6aa9ad /mm/memcontrol-v1.h
parent47d2702b20f514296dbd1e065ff93f926ca112bd (diff)
downloadlinux-b5855a26dedf210bcc1deb4cb30f9f657571a28a.tar.xz
mm: memcg: gather memcg1-specific fields initialization in memcg1_memcg_init()
Gather all memcg1-specific struct mem_cgroup's members initialization in a new memcg1_memcg_init() function, defined in mm/memcontrol-v1.c. Obviously, if CONFIG_MEMCG_V1 is not set, there is no need to initialize these fields, so the function becomes trivial. Link: https://lkml.kernel.org/r/20240628210317.272856-5-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>
Diffstat (limited to 'mm/memcontrol-v1.h')
-rw-r--r--mm/memcontrol-v1.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/memcontrol-v1.h b/mm/memcontrol-v1.h
index a5e35eb8374f..56d7eaa98274 100644
--- a/mm/memcontrol-v1.h
+++ b/mm/memcontrol-v1.h
@@ -71,6 +71,7 @@ int memory_stat_show(struct seq_file *m, void *v);
/* Cgroup v1-specific declarations */
#ifdef CONFIG_MEMCG_V1
+void memcg1_memcg_init(struct mem_cgroup *memcg);
void memcg1_remove_from_trees(struct mem_cgroup *memcg);
static inline void memcg1_soft_limit_reset(struct mem_cgroup *memcg)
@@ -119,6 +120,7 @@ extern struct cftype mem_cgroup_legacy_files[];
#else /* CONFIG_MEMCG_V1 */
+static inline void memcg1_memcg_init(struct mem_cgroup *memcg) {}
static inline void memcg1_remove_from_trees(struct mem_cgroup *memcg) {}
static inline void memcg1_soft_limit_reset(struct mem_cgroup *memcg) {}
static inline bool memcg1_wait_acct_move(struct mem_cgroup *memcg) { return false; }