summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRoman Gushchin <roman.gushchin@linux.dev>2024-06-29 00:03:16 +0300
committerAndrew Morton <akpm@linux-foundation.org>2024-07-05 04:05:57 +0300
commit1c3a0b3d0b11fb98c40360f849563185218c2dd4 (patch)
tree7703191c3cee39878a98de7582770c34162f4d1a /include
parent98c9daf5ae6be008f78c07b744bcff7bcc6e98da (diff)
downloadlinux-1c3a0b3d0b11fb98c40360f849563185218c2dd4.tar.xz
mm: memcg: put struct task_struct::memcg_in_oom under CONFIG_MEMCG_V1
The memcg_in_oom field of the struct task_struct is not used by the cgroup v2's memory controller, so it can be happily compiled out if CONFIG_MEMCG_V1 is not set. Link: https://lkml.kernel.org/r/20240628210317.272856-9-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 'include')
-rw-r--r--include/linux/sched.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 61591ac6eab6..2a16023e8620 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1447,9 +1447,11 @@ struct task_struct {
unsigned int kcov_softirq;
#endif
-#ifdef CONFIG_MEMCG
+#ifdef CONFIG_MEMCG_V1
struct mem_cgroup *memcg_in_oom;
+#endif
+#ifdef CONFIG_MEMCG
/* Number of pages to reclaim on returning to userland: */
unsigned int memcg_nr_pages_over_high;