]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/memcontrol.c
memcg: fix node_state handling
[linux-2.6-omap-h63xx.git] / mm / memcontrol.c
index 23b5fa4cabd8d7310b4adc3043f3c5232c47fa22..2e0bfc93484b327557e6b88f509476c4f837ac8f 100644 (file)
@@ -978,7 +978,7 @@ static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *mem, int node)
 {
        struct mem_cgroup_per_node *pn;
        struct mem_cgroup_per_zone *mz;
-       int zone;
+       int zone, tmp = node;
        /*
         * This routine is called against possible nodes.
         * But it's BUG to call kmalloc() against offline node.
@@ -987,10 +987,9 @@ static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *mem, int node)
         *       never be onlined. It's better to use memory hotplug callback
         *       function.
         */
-       if (node_state(node, N_HIGH_MEMORY))
-               pn = kmalloc_node(sizeof(*pn), GFP_KERNEL, node);
-       else
-               pn = kmalloc(sizeof(*pn), GFP_KERNEL);
+       if (!node_state(node, N_NORMAL_MEMORY))
+               tmp = -1;
+       pn = kmalloc_node(sizeof(*pn), GFP_KERNEL, tmp);
        if (!pn)
                return 1;