aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/hugetlb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 40ad2c6e0ca9..aa3b9a63394b 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -21,6 +21,7 @@
21#include <linux/rmap.h> 21#include <linux/rmap.h>
22#include <linux/swap.h> 22#include <linux/swap.h>
23#include <linux/swapops.h> 23#include <linux/swapops.h>
24#include <linux/page-isolation.h>
24 25
25#include <asm/page.h> 26#include <asm/page.h>
26#include <asm/pgtable.h> 27#include <asm/pgtable.h>
@@ -517,9 +518,15 @@ static struct page *dequeue_huge_page_node(struct hstate *h, int nid)
517{ 518{
518 struct page *page; 519 struct page *page;
519 520
520 if (list_empty(&h->hugepage_freelists[nid])) 521 list_for_each_entry(page, &h->hugepage_freelists[nid], lru)
522 if (!is_migrate_isolate_page(page))
523 break;
524 /*
525 * if 'non-isolated free hugepage' not found on the list,
526 * the allocation fails.
527 */
528 if (&h->hugepage_freelists[nid] == &page->lru)
521 return NULL; 529 return NULL;
522 page = list_entry(h->hugepage_freelists[nid].next, struct page, lru);
523 list_move(&page->lru, &h->hugepage_activelist); 530 list_move(&page->lru, &h->hugepage_activelist);
524 set_page_refcounted(page); 531 set_page_refcounted(page);
525 h->free_huge_pages--; 532 h->free_huge_pages--;