aboutsummaryrefslogtreecommitdiffstats
path: root/mm/swapfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index f1e69c30d203..9678182e0eef 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -646,6 +646,7 @@ static int try_to_unuse(unsigned int type)
646 */ 646 */
647 swap_map = &si->swap_map[i]; 647 swap_map = &si->swap_map[i];
648 entry = swp_entry(type, i); 648 entry = swp_entry(type, i);
649again:
649 page = read_swap_cache_async(entry, NULL, 0); 650 page = read_swap_cache_async(entry, NULL, 0);
650 if (!page) { 651 if (!page) {
651 /* 652 /*
@@ -680,6 +681,12 @@ static int try_to_unuse(unsigned int type)
680 wait_on_page_locked(page); 681 wait_on_page_locked(page);
681 wait_on_page_writeback(page); 682 wait_on_page_writeback(page);
682 lock_page(page); 683 lock_page(page);
684 if (!PageSwapCache(page)) {
685 /* Page migration has occured */
686 unlock_page(page);
687 page_cache_release(page);
688 goto again;
689 }
683 wait_on_page_writeback(page); 690 wait_on_page_writeback(page);
684 691
685 /* 692 /*