From: Glauber Costa Date: Wed, 20 Feb 2013 02:14:46 +0000 (+1100) Subject: memcg: fast hierarchy-aware child test fix X-Git-Tag: next-20130220~1^2~442 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e42b5369142a30183a4bdc173acbdc1b123a63a3;p=karo-tx-linux.git memcg: fast hierarchy-aware child test fix Cc: Glauber Costa Cc: Hiroyuki Kamezawa Cc: Johannes Weiner Acked-by: Michal Hocko Cc: Tejun Heo Signed-off-by: Andrew Morton --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 79ae372e6e8c..2bc3fbe93154 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -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; }