diff options
Diffstat (limited to 'mm/swap_state.c')
-rw-r--r-- | mm/swap_state.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c index 473b71e052a8..539b8885e3d1 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c | |||
@@ -360,17 +360,7 @@ struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, | |||
360 | /* | 360 | /* |
361 | * We might race against get_swap_page() and stumble | 361 | * We might race against get_swap_page() and stumble |
362 | * across a SWAP_HAS_CACHE swap_map entry whose page | 362 | * across a SWAP_HAS_CACHE swap_map entry whose page |
363 | * has not been brought into the swapcache yet, while | 363 | * has not been brought into the swapcache yet. |
364 | * the other end is scheduled away waiting on discard | ||
365 | * I/O completion at scan_swap_map(). | ||
366 | * | ||
367 | * In order to avoid turning this transitory state | ||
368 | * into a permanent loop around this -EEXIST case | ||
369 | * if !CONFIG_PREEMPT and the I/O completion happens | ||
370 | * to be waiting on the CPU waitqueue where we are now | ||
371 | * busy looping, we just conditionally invoke the | ||
372 | * scheduler here, if there are some more important | ||
373 | * tasks to run. | ||
374 | */ | 364 | */ |
375 | cond_resched(); | 365 | cond_resched(); |
376 | continue; | 366 | continue; |
@@ -533,7 +523,7 @@ int init_swap_address_space(unsigned int type, unsigned long nr_pages) | |||
533 | unsigned int i, nr; | 523 | unsigned int i, nr; |
534 | 524 | ||
535 | nr = DIV_ROUND_UP(nr_pages, SWAP_ADDRESS_SPACE_PAGES); | 525 | nr = DIV_ROUND_UP(nr_pages, SWAP_ADDRESS_SPACE_PAGES); |
536 | spaces = vzalloc(sizeof(struct address_space) * nr); | 526 | spaces = kvzalloc(sizeof(struct address_space) * nr, GFP_KERNEL); |
537 | if (!spaces) | 527 | if (!spaces) |
538 | return -ENOMEM; | 528 | return -ENOMEM; |
539 | for (i = 0; i < nr; i++) { | 529 | for (i = 0; i < nr; i++) { |