aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index a537a7f16357..58270aea669a 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -568,6 +568,7 @@ keep:
568 return reclaimed; 568 return reclaimed;
569} 569}
570 570
571#ifdef CONFIG_MIGRATION
571/* 572/*
572 * swapout a single page 573 * swapout a single page
573 * page is locked upon entry, unlocked on exit 574 * page is locked upon entry, unlocked on exit
@@ -656,8 +657,9 @@ redo:
656 657
657 /* 658 /*
658 * Skip locked pages during the first two passes to give the 659 * Skip locked pages during the first two passes to give the
659 * functions holding the lock time to release the page. Later we use 660 * functions holding the lock time to release the page. Later we
660 * lock_page to have a higher chance of acquiring the lock. 661 * use lock_page() to have a higher chance of acquiring the
662 * lock.
661 */ 663 */
662 if (pass > 2) 664 if (pass > 2)
663 lock_page(page); 665 lock_page(page);
@@ -669,15 +671,15 @@ redo:
669 * Only wait on writeback if we have already done a pass where 671 * Only wait on writeback if we have already done a pass where
670 * we we may have triggered writeouts for lots of pages. 672 * we we may have triggered writeouts for lots of pages.
671 */ 673 */
672 if (pass > 0) 674 if (pass > 0) {
673 wait_on_page_writeback(page); 675 wait_on_page_writeback(page);
674 else 676 } else {
675 if (PageWriteback(page)) { 677 if (PageWriteback(page)) {
676 unlock_page(page); 678 unlock_page(page);
677 goto retry_later; 679 goto retry_later;
678 } 680 }
681 }
679 682
680#ifdef CONFIG_SWAP
681 if (PageAnon(page) && !PageSwapCache(page)) { 683 if (PageAnon(page) && !PageSwapCache(page)) {
682 if (!add_to_swap(page)) { 684 if (!add_to_swap(page)) {
683 unlock_page(page); 685 unlock_page(page);
@@ -686,16 +688,15 @@ redo:
686 continue; 688 continue;
687 } 689 }
688 } 690 }
689#endif /* CONFIG_SWAP */
690 691
691 /* 692 /*
692 * Page is properly locked and writeback is complete. 693 * Page is properly locked and writeback is complete.
693 * Try to migrate the page. 694 * Try to migrate the page.
694 */ 695 */
695 if (swap_page(page)) { 696 if (!swap_page(page))
697 continue;
696retry_later: 698retry_later:
697 retry++; 699 retry++;
698 }
699 } 700 }
700 if (retry && pass++ < 10) 701 if (retry && pass++ < 10)
701 goto redo; 702 goto redo;
@@ -708,6 +709,7 @@ retry_later:
708 709
709 return nr_failed + retry; 710 return nr_failed + retry;
710} 711}
712#endif
711 713
712/* 714/*
713 * zone->lru_lock is heavily contended. Some of the functions that 715 * zone->lru_lock is heavily contended. Some of the functions that