[PATCH 2/7] Swap Migration: Consolidate successful migration handling
From: Christoph Lameter
Date: Mon Nov 28 2005 - 15:43:57 EST
SwapMig: consolidate successful migration handling
Handle the moving of migrated pages to the "moved" list in a common branch
for rc == 0.
Signed-off-by: Christoph Lameter <clameter@xxxxxxx>
Index: linux-2.6.15-rc2-mm1/mm/vmscan.c
===================================================================
--- linux-2.6.15-rc2-mm1.orig/mm/vmscan.c 2005-11-28 11:23:45.000000000 -0800
+++ linux-2.6.15-rc2-mm1/mm/vmscan.c 2005-11-28 11:25:14.000000000 -0800
@@ -702,11 +702,11 @@ redo:
list_for_each_entry_safe(page, page2, from, lru) {
cond_resched();
- if (page_count(page) == 1) {
+ rc = 0;
+ if (page_count(page) == 1)
/* page was freed from under us. So we are done. */
- list_move(&page->lru, moved);
- continue;
- }
+ goto next;
+
/*
* Skip locked pages during the first two passes to give the
* functions holding the lock time to release the page. Later we
@@ -747,10 +747,7 @@ redo:
* Page is properly locked and writeback is complete.
* Try to migrate the page.
*/
- if (!swap_page(page)) {
- list_move(&page->lru, moved);
- continue;
- }
+ rc = swap_page(page);
goto next;
unlock_page:
@@ -761,9 +758,12 @@ next:
retry++;
else if (rc) {
- /* Permanent failure to migrate the page */
+ /* Permanent failure */
list_move(&page->lru, failed);
nr_failed++;
+ } else {
+ /* Success */
+ list_move(&page->lru, moved);
}
}
if (retry && pass++ < 10)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/