From: Mircea CIRJALIU - MELIU <mcirjaliu@bitdefender.com>
To: "linux-mm@kvack.org" <linux-mm@kvack.org>, "cl@linux.com" <cl@linux.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] slab, memcontrol: undefined reference to `memcg_kmem_get_cache'
Date: Tue, 24 Sep 2019 08:46:48 +0000 [thread overview]
Message-ID: <DB7PR02MB397977A2959BFFA89AA67538BB840@DB7PR02MB3979.eurprd02.prod.outlook.com> (raw)
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)
{
next reply other threads:[~2019-09-24 8:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-24 8:46 Mircea CIRJALIU - MELIU [this message]
2019-09-24 12:04 ` Michal Hocko
2019-09-24 14:08 ` Mircea CIRJALIU - MELIU
2019-09-24 14:36 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB7PR02MB397977A2959BFFA89AA67538BB840@DB7PR02MB3979.eurprd02.prod.outlook.com \
--to=mcirjaliu@bitdefender.com \
--cc=cl@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox