hugetlb: do not fail in hugetlb_cgroup_pre_destroy
[~shefty/rdma-dev.git] / mm / hugetlb_cgroup.c
index a3f358fb8a0c81bcb7cca5ce7c52c29f002b4261..dc595c6b1f55607939b74b6db1ef57c752431a71 100644 (file)
@@ -159,14 +159,9 @@ static int hugetlb_cgroup_pre_destroy(struct cgroup *cgroup)
 {
        struct hstate *h;
        struct page *page;
 {
        struct hstate *h;
        struct page *page;
-       int ret = 0, idx = 0;
+       int idx = 0;
 
        do {
 
        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)
                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));
                }
                cond_resched();
        } while (hugetlb_cgroup_have_usage(cgroup));
-out:
-       return ret;
+
+       return 0;
 }
 
 int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,
 }
 
 int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,