aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/hugetlb.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index c57740bb203a..ec7b86ebf9d9 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -928,8 +928,14 @@ struct page *alloc_huge_page_node(struct hstate *h, int nid)
928 page = dequeue_huge_page_node(h, nid); 928 page = dequeue_huge_page_node(h, nid);
929 spin_unlock(&hugetlb_lock); 929 spin_unlock(&hugetlb_lock);
930 930
931 if (!page) 931 if (!page) {
932 page = alloc_buddy_huge_page(h, nid); 932 page = alloc_buddy_huge_page(h, nid);
933 if (page) {
934 spin_lock(&hugetlb_lock);
935 list_move(&page->lru, &h->hugepage_activelist);
936 spin_unlock(&hugetlb_lock);
937 }
938 }
933 939
934 return page; 940 return page;
935} 941}
@@ -1155,6 +1161,9 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma,
1155 hugepage_subpool_put_pages(spool, chg); 1161 hugepage_subpool_put_pages(spool, chg);
1156 return ERR_PTR(-ENOSPC); 1162 return ERR_PTR(-ENOSPC);
1157 } 1163 }
1164 spin_lock(&hugetlb_lock);
1165 list_move(&page->lru, &h->hugepage_activelist);
1166 spin_unlock(&hugetlb_lock);
1158 } 1167 }
1159 1168
1160 set_page_private(page, (unsigned long)spool); 1169 set_page_private(page, (unsigned long)spool);