summaryrefslogtreecommitdiffstats
path: root/kernel/mm/hugetlb_cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/mm/hugetlb_cgroup.c')
-rw-r--r--kernel/mm/hugetlb_cgroup.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/mm/hugetlb_cgroup.c b/kernel/mm/hugetlb_cgroup.c
index 6e0057439..d8fb10de0 100644
--- a/kernel/mm/hugetlb_cgroup.c
+++ b/kernel/mm/hugetlb_cgroup.c
@@ -186,7 +186,8 @@ again:
}
rcu_read_unlock();
- ret = page_counter_try_charge(&h_cg->hugepage[idx], nr_pages, &counter);
+ if (!page_counter_try_charge(&h_cg->hugepage[idx], nr_pages, &counter))
+ ret = -ENOMEM;
css_put(&h_cg->css);
done:
*ptr = h_cg;
@@ -384,7 +385,7 @@ void __init hugetlb_cgroup_file_init(void)
/*
* Add cgroup control files only if the huge page consists
* of more than two normal pages. This is because we use
- * page[2].lru.next for storing cgroup details.
+ * page[2].private for storing cgroup details.
*/
if (huge_page_order(h) >= HUGETLB_CGROUP_MIN_ORDER)
__hugetlb_cgroup_file_init(hstate_index(h));