diff --git a/mm/hugetlb.c b/mm/hugetlb.c index e8ef6c62da34c1195444211f926fa7dd22512e22..fb1f90eed7fc31ebe84f6180cecd801e30d61638 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2271,11 +2271,11 @@ struct page *alloc_huge_page(struct vm_area_struct *vma, page = alloc_buddy_huge_page_with_mpol(h, vma, addr); if (!page) goto out_uncharge_cgroup; + spin_lock(&hugetlb_lock); if (!avoid_reserve && vma_has_reserves(vma, gbl_chg)) { SetPagePrivate(page); h->resv_huge_pages--; } - spin_lock(&hugetlb_lock); list_move(&page->lru, &h->hugepage_activelist); /* Fall through */ }