From: Christoph Lameter Handle the moving of migrated pages to the "moved" list in a common branch for rc == 0. Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton --- mm/vmscan.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff -puN mm/vmscan.c~swapmig-switch-error-handling-in-migrate_pages-to-use-exx-cleanup mm/vmscan.c --- devel/mm/vmscan.c~swapmig-switch-error-handling-in-migrate_pages-to-use-exx-cleanup 2005-11-28 12:46:59.000000000 -0800 +++ devel-akpm/mm/vmscan.c 2005-11-28 12:46:59.000000000 -0800 @@ -697,11 +697,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 @@ -742,10 +742,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: @@ -756,9 +753,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) _