linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: memcontrol.c: move mem_cgroup_id_get_many under CONFIG_MMU
@ 2019-12-17  6:47 Kuninori Morimoto
  2019-12-17  9:53 ` Michal Hocko
  0 siblings, 1 reply; 16+ messages in thread
From: Kuninori Morimoto @ 2019-12-17  6:47 UTC (permalink / raw)
  To: Johannes Weiner, Michal Hocko, Vladimir Davydov, Andrew Morton
  Cc: cgroups, linux-mm, linux-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

mem_cgroup_id_get_many() is used under CONFIG_MMU.
This patch moves it to under CONFIG_MMU.
We will get below warning without this patch
if .config doesn't have CONFIG_MMU.

	LINUX/mm/memcontrol.c:4814:13: warning: 'mem_cgroup_id_get_many'\
		defined but not used [-Wunused-function]
	static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n)
	^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 mm/memcontrol.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c5b5f74..8a157ef 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4811,11 +4811,6 @@ static void mem_cgroup_id_remove(struct mem_cgroup *memcg)
 	}
 }
 
-static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n)
-{
-	refcount_add(n, &memcg->id.ref);
-}
-
 static void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n)
 {
 	if (refcount_sub_and_test(n, &memcg->id.ref)) {
@@ -5153,6 +5148,11 @@ static void mem_cgroup_css_reset(struct cgroup_subsys_state *css)
 }
 
 #ifdef CONFIG_MMU
+static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n)
+{
+	refcount_add(n, &memcg->id.ref);
+}
+
 /* Handlers for move charge at task migration. */
 static int mem_cgroup_do_precharge(unsigned long count)
 {
-- 
2.7.4


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

end of thread, other threads:[~2019-12-17 15:46 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17  6:47 [PATCH] mm: memcontrol.c: move mem_cgroup_id_get_many under CONFIG_MMU Kuninori Morimoto
2019-12-17  9:53 ` Michal Hocko
2019-12-17 13:54   ` Chris Down
2019-12-17 14:16     ` Qian Cai
2019-12-17 14:37       ` Chris Down
2019-12-17 15:09         ` Qian Cai
2019-12-17 14:46       ` Michal Hocko
2019-12-17 15:04         ` Qian Cai
2019-12-17 15:13           ` Michal Hocko
2019-12-17 15:17             ` Qian Cai
2019-12-17 15:09         ` Chris Down
2019-12-17 15:19           ` Michal Hocko
2019-12-17 15:28             ` Chris Down
2019-12-17 15:32               ` Chris Down
2019-12-17 15:34               ` Qian Cai
2019-12-17 15:46               ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).