diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 504c9699b1af0bbb5771867c42e6434836ce6d05..fd77bf4979a9b1a71e9ce79e0ff33d2e864e0381 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4653,6 +4653,11 @@ void *page_frag_alloc(struct page_frag_cache *nc, if (!page_ref_sub_and_test(page, nc->pagecnt_bias)) goto refill; + if (unlikely(nc->pfmemalloc)) { + free_the_page(page, compound_order(page)); + goto refill; + } + #if (PAGE_SIZE < PAGE_FRAG_CACHE_MAX_SIZE) /* if size can vary use size else just use PAGE_SIZE */ size = nc->size;