diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mempolicy.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index cc61c7a7d6a1..41a42902ef21 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1198,14 +1198,16 @@ static struct page *new_page(struct page *page, unsigned long start, int **x) break; vma = vma->vm_next; } + + if (PageHuge(page)) { + if (vma) + return alloc_huge_page_noerr(vma, address, 1); + else + return NULL; + } /* - * queue_pages_range() confirms that @page belongs to some vma, - * so vma shouldn't be NULL. + * if !vma, alloc_page_vma() will use task or system default policy */ - BUG_ON(!vma); - - if (PageHuge(page)) - return alloc_huge_page_noerr(vma, address, 1); return alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, address); } #else |