diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-17 22:54:25 +0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-17 22:54:25 +0400 |
| commit | 0e496b8e84410c96d1ffc86f0b37b0328a4234da (patch) | |
| tree | d8a2aeeaee03eb4f305ba4dc5ab9395c4ee31321 /mm/swap_state.c | |
| parent | 214da6728acac285cac0e8e9b6c4c13838b8e1b0 (diff) | |
| parent | 7d132055814ef17a6c7b69f342244c410a5e000f (diff) | |
| download | linux-0e496b8e84410c96d1ffc86f0b37b0328a4234da.tar.xz | |
Merge 3.10-rc6 into char-misc-next
We want the fixes in here.
Diffstat (limited to 'mm/swap_state.c')
| -rw-r--r-- | mm/swap_state.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c index b3d40dcf3624..f24ab0dff554 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -336,8 +336,24 @@ struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, * Swap entry may have been freed since our caller observed it. */ err = swapcache_prepare(entry); - if (err == -EEXIST) { /* seems racy */ + if (err == -EEXIST) { radix_tree_preload_end(); + /* + * We might race against get_swap_page() and stumble + * across a SWAP_HAS_CACHE swap_map entry whose page + * has not been brought into the swapcache yet, while + * the other end is scheduled away waiting on discard + * I/O completion at scan_swap_map(). + * + * In order to avoid turning this transitory state + * into a permanent loop around this -EEXIST case + * if !CONFIG_PREEMPT and the I/O completion happens + * to be waiting on the CPU waitqueue where we are now + * busy looping, we just conditionally invoke the + * scheduler here, if there are some more important + * tasks to run. + */ + cond_resched(); continue; } if (err) { /* swp entry is obsolete ? */ |
