From: Michal Hocko Date: Fri, 26 Oct 2012 11:37:33 +0000 (+0200) Subject: hugetlb: do not fail in hugetlb_cgroup_pre_destroy X-Git-Tag: v3.8-rc1~151^2~47^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9d093cb10eb482adfba6ddc71a0969b78823ee8b;p=platform%2Fkernel%2Flinux-stable.git hugetlb: do not fail in hugetlb_cgroup_pre_destroy Now that pre_destroy callbacks are called from the context where neither any task can attach the group nor any children group can be added there is no other way to fail from hugetlb_pre_destroy. Signed-off-by: Michal Hocko Reviewed-by: Tejun Heo Reviewed-by: Glauber Costa Acked-by: KAMEZAWA Hiroyuki Signed-off-by: Tejun Heo --- diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c index a3f358f..dc595c6 100644 --- a/mm/hugetlb_cgroup.c +++ b/mm/hugetlb_cgroup.c @@ -159,14 +159,9 @@ static int hugetlb_cgroup_pre_destroy(struct cgroup *cgroup) { struct hstate *h; struct page *page; - int ret = 0, idx = 0; + int idx = 0; do { - if (cgroup_task_count(cgroup) || - !list_empty(&cgroup->children)) { - ret = -EBUSY; - goto out; - } for_each_hstate(h) { spin_lock(&hugetlb_lock); list_for_each_entry(page, &h->hugepage_activelist, lru) @@ -177,8 +172,8 @@ static int hugetlb_cgroup_pre_destroy(struct cgroup *cgroup) } cond_resched(); } while (hugetlb_cgroup_have_usage(cgroup)); -out: - return ret; + + return 0; } int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,