linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is not defined.
@ 2024-08-20 19:50 Kanchana P Sridhar
  2024-08-21 15:11 ` Michal Hocko
  2024-08-21 19:24 ` Nhat Pham
  0 siblings, 2 replies; 7+ messages in thread
From: Kanchana P Sridhar @ 2024-08-20 19:50 UTC (permalink / raw)
  To: linux-kernel, linux-mm, hannes, yosryahmed, nphamcs,
	ryan.roberts, ying.huang, 21cnbao, akpm
  Cc: nanhai.zou, wajdi.k.feghali, vinodh.gopal, kanchana.p.sridhar

This resolves an issue with obj_cgroup_get() not being defined
if CONFIG_MEMCG is not defined. This causes build errors if
obj_cgroup_get() is called from code that is agnostic of CONFIG_MEMCG.

The patch resolves this.

Signed-off-by: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
---
 include/linux/memcontrol.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index fe05fdb92779..f693d254ab2a 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -1281,6 +1281,10 @@ struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css)
 	return NULL;
 }
 
+static inline void obj_cgroup_get(struct obj_cgroup *objcg)
+{
+}
+
 static inline void obj_cgroup_put(struct obj_cgroup *objcg)
 {
 }

base-commit: 7d0b0d4b77b368b2111fc8b4449e33dfb3c34087
-- 
2.27.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-08-22 16:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-20 19:50 [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is not defined Kanchana P Sridhar
2024-08-21 15:11 ` Michal Hocko
2024-08-21 19:16   ` Sridhar, Kanchana P
2024-08-21 19:24 ` Nhat Pham
2024-08-21 19:40   ` Sridhar, Kanchana P
2024-08-22  6:14     ` Michal Hocko
2024-08-22 16:19       ` Sridhar, Kanchana P

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox