Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 376967
b: refs/heads/master
c: cbab0e4
h: refs/heads/master
i:
  376965: 009cef3
  376963: 26f1513
  376959: 3f0d9f7
v: v3
  • Loading branch information
Rafael Aquini authored and Linus Torvalds committed Jun 12, 2013
1 parent a9cf02f commit 52f1f6d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24b8256a1fb28d357bc6fa09184ba29b4255ba5c
refs/heads/master: cbab0e4eec299e9059199ebe6daf48730be46d2b
18 changes: 17 additions & 1 deletion trunk/mm/swap_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? */
Expand Down

0 comments on commit 52f1f6d

Please sign in to comment.