From aea0c7249a89b84166b383a59054c3c754003123 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 29 Nov 2012 14:16:41 +1100 Subject: [PATCH] memcg: simplify ida initialization As suggested by akpm, change the manual initialization of our kmem index to DEFINE_IDA() Signed-off-by: Glauber Costa Cc: Michal Hocko Cc: Kamezawa Hiroyuki Cc: Johannes Weiner Acked-by: David Rientjes Signed-off-by: Andrew Morton --- mm/memcontrol.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 9a3c622a6ac4..35f9dd370ea8 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -569,7 +569,7 @@ static void disarm_sock_keys(struct mem_cgroup *memcg) * memcg_limited_groups_array_size. It will double each time we have to * increase it. */ -static struct ida kmem_limited_groups; +static DEFINE_IDA(kmem_limited_groups); static int memcg_limited_groups_array_size; /* * MIN_SIZE is different than 1, because we would like to avoid going through @@ -5253,9 +5253,6 @@ static int memcg_init_kmem(struct mem_cgroup *memcg, struct cgroup_subsys *ss) if (ret) return ret; - if (mem_cgroup_is_root(memcg)) - ida_init(&kmem_limited_groups); - return mem_cgroup_sockets_init(memcg, ss); }; -- 2.39.5