|
@@ -955,10 +955,11 @@ static struct page *alloc_buddy_huge_page(struct hstate *h, int nid)
|
|
|
*/
|
|
|
struct page *alloc_huge_page_node(struct hstate *h, int nid)
|
|
|
{
|
|
|
- struct page *page;
|
|
|
+ struct page *page = NULL;
|
|
|
|
|
|
spin_lock(&hugetlb_lock);
|
|
|
- page = dequeue_huge_page_node(h, nid);
|
|
|
+ if (h->free_huge_pages - h->resv_huge_pages > 0)
|
|
|
+ page = dequeue_huge_page_node(h, nid);
|
|
|
spin_unlock(&hugetlb_lock);
|
|
|
|
|
|
if (!page)
|