diff --git a/mm/page_alloc.c b/mm/page_alloc.c index f271929abeabc1fc8da1c8557551e891f722489c..853d65d5420ff630c56562ae96fdc3556d95759d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4963,6 +4963,10 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int preferred_nid, while (page_array && nr_populated < nr_pages && page_array[nr_populated]) nr_populated++; + /* Already populated array? */ + if (unlikely(page_array && nr_pages - nr_populated == 0)) + return 0; + /* Use the single page allocator for one page. */ if (nr_pages - nr_populated == 1) goto failed;