diff options
-rw-r--r-- | mm/hugetlb.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index bfca1b00b09b..a698d40d1c3e 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -1166,12 +1166,7 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma, | |||
1166 | } | 1166 | } |
1167 | spin_lock(&hugetlb_lock); | 1167 | spin_lock(&hugetlb_lock); |
1168 | page = dequeue_huge_page_vma(h, vma, addr, avoid_reserve); | 1168 | page = dequeue_huge_page_vma(h, vma, addr, avoid_reserve); |
1169 | if (page) { | 1169 | if (!page) { |
1170 | /* update page cgroup details */ | ||
1171 | hugetlb_cgroup_commit_charge(idx, pages_per_huge_page(h), | ||
1172 | h_cg, page); | ||
1173 | spin_unlock(&hugetlb_lock); | ||
1174 | } else { | ||
1175 | spin_unlock(&hugetlb_lock); | 1170 | spin_unlock(&hugetlb_lock); |
1176 | page = alloc_buddy_huge_page(h, NUMA_NO_NODE); | 1171 | page = alloc_buddy_huge_page(h, NUMA_NO_NODE); |
1177 | if (!page) { | 1172 | if (!page) { |
@@ -1182,11 +1177,11 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma, | |||
1182 | return ERR_PTR(-ENOSPC); | 1177 | return ERR_PTR(-ENOSPC); |
1183 | } | 1178 | } |
1184 | spin_lock(&hugetlb_lock); | 1179 | spin_lock(&hugetlb_lock); |
1185 | hugetlb_cgroup_commit_charge(idx, pages_per_huge_page(h), | ||
1186 | h_cg, page); | ||
1187 | list_move(&page->lru, &h->hugepage_activelist); | 1180 | list_move(&page->lru, &h->hugepage_activelist); |
1188 | spin_unlock(&hugetlb_lock); | 1181 | /* Fall through */ |
1189 | } | 1182 | } |
1183 | hugetlb_cgroup_commit_charge(idx, pages_per_huge_page(h), h_cg, page); | ||
1184 | spin_unlock(&hugetlb_lock); | ||
1190 | 1185 | ||
1191 | set_page_private(page, (unsigned long)spool); | 1186 | set_page_private(page, (unsigned long)spool); |
1192 | 1187 | ||