From e42b5369142a30183a4bdc173acbdc1b123a63a3 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Wed, 20 Feb 2013 13:14:46 +1100 Subject: [PATCH] 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 --- mm/memcontrol.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; } -- 2.39.5