diff mbox series

[v1,3/9] mm: memcg: guard cgroup v1-specific code in mem_cgroup_print_oom_meminfo()

Message ID 20240628210317.272856-4-roman.gushchin@linux.dev (mailing list archive)
State New
Headers show
Series mm: memcg: put cgroup v1-specific memcg data under CONFIG_MEMCG_V1 | expand

Commit Message

Roman Gushchin June 28, 2024, 9:03 p.m. UTC
Put cgroup v1-specific code in mem_cgroup_print_oom_meminfo() under
CONFIG_MEMCG_V1.

Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
---
 mm/memcontrol.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Shakeel Butt June 29, 2024, 12:40 a.m. UTC | #1
On Fri, Jun 28, 2024 at 09:03:11PM GMT, Roman Gushchin wrote:
> Put cgroup v1-specific code in mem_cgroup_print_oom_meminfo() under
> CONFIG_MEMCG_V1.
> 
> Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>

Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
diff mbox series

Patch

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 2c0605bbbb31..b69abd327549 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1532,6 +1532,7 @@  void mem_cgroup_print_oom_meminfo(struct mem_cgroup *memcg)
 		pr_info("swap: usage %llukB, limit %llukB, failcnt %lu\n",
 			K((u64)page_counter_read(&memcg->swap)),
 			K((u64)READ_ONCE(memcg->swap.max)), memcg->swap.failcnt);
+#ifdef CONFIG_MEMCG_V1
 	else {
 		pr_info("memory+swap: usage %llukB, limit %llukB, failcnt %lu\n",
 			K((u64)page_counter_read(&memcg->memsw)),
@@ -1540,6 +1541,7 @@  void mem_cgroup_print_oom_meminfo(struct mem_cgroup *memcg)
 			K((u64)page_counter_read(&memcg->kmem)),
 			K((u64)memcg->kmem.max), memcg->kmem.failcnt);
 	}
+#endif
 
 	pr_info("Memory cgroup stats for ");
 	pr_cont_cgroup_path(memcg->css.cgroup);