]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
memcg: fast hierarchy-aware child test fix
authorGlauber Costa <glommer@parallels.com>
Wed, 20 Feb 2013 02:14:46 +0000 (13:14 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:52:50 +0000 (16:52 +1100)
Cc: Glauber Costa <glommer@parallels.com>
Cc: Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c

index 79ae372e6e8cd2df8fd7829d65bc92e41e8669f7..2bc3fbe931549bd728034b4c014531119c97e1e3 100644 (file)
@@ -5734,8 +5734,7 @@ static int mem_cgroup_oom_control_write(struct cgroup *cgrp,
 
        cgroup_lock();
        /* oom-kill-disable is a flag for subhierarchy. */
-       if ((parent->use_hierarchy) ||
-           (memcg->use_hierarchy && !list_empty(&cgrp->children))) {
+       if ((parent->use_hierarchy) || memcg_has_children(memcg)) {
                cgroup_unlock();
                return -EINVAL;
        }