linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] slab, memcontrol: undefined reference to `memcg_kmem_get_cache'
@ 2019-09-24  8:46 Mircea CIRJALIU - MELIU
  2019-09-24 12:04 ` Michal Hocko
  0 siblings, 1 reply; 4+ messages in thread
From: Mircea CIRJALIU - MELIU @ 2019-09-24  8:46 UTC (permalink / raw)
  To: linux-mm, cl; +Cc: linux-kernel

Having CONFIG_MEMCG turned off causes these issues:
	mm/slub.o: In function `slab_pre_alloc_hook':
	/home/mircea/build/mm/slab.h:425: undefined reference to `memcg_kmem_get_cache'
	mm/slub.o: In function `slab_post_alloc_hook':
	/home/mircea/build/mm/slab.h:444: undefined reference to `memcg_kmem_put_cache'

diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 1dcb763..61a1391 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -1265,10 +1265,10 @@ static inline bool mem_cgroup_under_socket_pressure(struct mem_cgroup *memcg)
 }
 #endif

+#ifdef CONFIG_MEMCG_KMEM
 struct kmem_cache *memcg_kmem_get_cache(struct kmem_cache *cachep);
 void memcg_kmem_put_cache(struct kmem_cache *cachep);

-#ifdef CONFIG_MEMCG_KMEM
 int __memcg_kmem_charge(struct page *page, gfp_t gfp, int order);
 void __memcg_kmem_uncharge(struct page *page, int order);
 int __memcg_kmem_charge_memcg(struct page *page, gfp_t gfp, int order,
@@ -1329,6 +1329,14 @@ extern int memcg_expand_shrinker_maps(int new_id);
 extern void memcg_set_shrinker_bit(struct mem_cgroup *memcg,
                                   int nid, int shrinker_id);
 #else
+static inline struct kmem_cache *memcg_kmem_get_cache(struct kmem_cache *cachep)
+{
+       return cachep;
+}
+
+static inline void memcg_kmem_put_cache(struct kmem_cache *cachep)
+{
+}

 static inline int memcg_kmem_charge(struct page *page, gfp_t gfp, int order)
 {


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

end of thread, other threads:[~2019-09-24 14:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24  8:46 [PATCH] slab, memcontrol: undefined reference to `memcg_kmem_get_cache' Mircea CIRJALIU - MELIU
2019-09-24 12:04 ` Michal Hocko
2019-09-24 14:08   ` Mircea CIRJALIU - MELIU
2019-09-24 14:36     ` Michal Hocko

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