diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index df959b7d6085..5b5240b7f642 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1343,12 +1343,15 @@ static int prep_new_page(struct page *page, unsigned int order, gfp_t gfp_flags, | |||
1343 | set_page_owner(page, order, gfp_flags); | 1343 | set_page_owner(page, order, gfp_flags); |
1344 | 1344 | ||
1345 | /* | 1345 | /* |
1346 | * page->pfmemalloc is set when ALLOC_NO_WATERMARKS was necessary to | 1346 | * page is set pfmemalloc when ALLOC_NO_WATERMARKS was necessary to |
1347 | * allocate the page. The expectation is that the caller is taking | 1347 | * allocate the page. The expectation is that the caller is taking |
1348 | * steps that will free more memory. The caller should avoid the page | 1348 | * steps that will free more memory. The caller should avoid the page |
1349 | * being used for !PFMEMALLOC purposes. | 1349 | * being used for !PFMEMALLOC purposes. |
1350 | */ | 1350 | */ |
1351 | page->pfmemalloc = !!(alloc_flags & ALLOC_NO_WATERMARKS); | 1351 | if (alloc_flags & ALLOC_NO_WATERMARKS) |
1352 | set_page_pfmemalloc(page); | ||
1353 | else | ||
1354 | clear_page_pfmemalloc(page); | ||
1352 | 1355 | ||
1353 | return 0; | 1356 | return 0; |
1354 | } | 1357 | } |
@@ -3345,7 +3348,7 @@ refill: | |||
3345 | atomic_add(size - 1, &page->_count); | 3348 | atomic_add(size - 1, &page->_count); |
3346 | 3349 | ||
3347 | /* reset page count bias and offset to start of new frag */ | 3350 | /* reset page count bias and offset to start of new frag */ |
3348 | nc->pfmemalloc = page->pfmemalloc; | 3351 | nc->pfmemalloc = page_is_pfmemalloc(page); |
3349 | nc->pagecnt_bias = size; | 3352 | nc->pagecnt_bias = size; |
3350 | nc->offset = size; | 3353 | nc->offset = size; |
3351 | } | 3354 | } |