summaryrefslogtreecommitdiffstats
path: root/kernel/mm/page_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/mm/page_alloc.c')
-rw-r--r--kernel/mm/page_alloc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/mm/page_alloc.c b/kernel/mm/page_alloc.c
index 5b70c9977..41bd90d60 100644
--- a/kernel/mm/page_alloc.c
+++ b/kernel/mm/page_alloc.c
@@ -1021,12 +1021,15 @@ static int prep_new_page(struct page *page, unsigned int order, gfp_t gfp_flags,
set_page_owner(page, order, gfp_flags);
/*
- * page->pfmemalloc is set when ALLOC_NO_WATERMARKS was necessary to
+ * page is set pfmemalloc when ALLOC_NO_WATERMARKS was necessary to
* allocate the page. The expectation is that the caller is taking
* steps that will free more memory. The caller should avoid the page
* being used for !PFMEMALLOC purposes.
*/
- page->pfmemalloc = !!(alloc_flags & ALLOC_NO_WATERMARKS);
+ if (alloc_flags & ALLOC_NO_WATERMARKS)
+ set_page_pfmemalloc(page);
+ else
+ clear_page_pfmemalloc(page);
return 0;
}