]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
memcg: simplify ida initialization
authorGlauber Costa <glommer@parallels.com>
Thu, 29 Nov 2012 03:16:41 +0000 (14:16 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 5 Dec 2012 05:22:58 +0000 (16:22 +1100)
As suggested by akpm, change the manual initialization of our kmem
index to DEFINE_IDA()

Signed-off-by: Glauber Costa <glommer@parallels.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c

index 9a3c622a6ac479364acf4a25d48607311dc8dfe7..35f9dd370ea8824e10a0c0734a113326f3d734da 100644 (file)
@@ -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);
 };