diff options
Diffstat (limited to 'mm/filemap.c')
-rw-r--r-- | mm/filemap.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index f3230604006c..843042045dc9 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -499,10 +499,13 @@ struct page *__page_cache_alloc(gfp_t gfp) | |||
499 | struct page *page; | 499 | struct page *page; |
500 | 500 | ||
501 | if (cpuset_do_page_mem_spread()) { | 501 | if (cpuset_do_page_mem_spread()) { |
502 | get_mems_allowed(); | 502 | unsigned int cpuset_mems_cookie; |
503 | n = cpuset_mem_spread_node(); | 503 | do { |
504 | page = alloc_pages_exact_node(n, gfp, 0); | 504 | cpuset_mems_cookie = get_mems_allowed(); |
505 | put_mems_allowed(); | 505 | n = cpuset_mem_spread_node(); |
506 | page = alloc_pages_exact_node(n, gfp, 0); | ||
507 | } while (!put_mems_allowed(cpuset_mems_cookie) && !page); | ||
508 | |||
506 | return page; | 509 | return page; |
507 | } | 510 | } |
508 | return alloc_pages(gfp, 0); | 511 | return alloc_pages(gfp, 0); |