From: Andrew Morton - The feature needs CONFIG_SWAP - Hence we can lose some ifdefs - on_each_cpu() calls the helper directly on !SMP, so put it back. Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton --- mm/Kconfig | 3 +-- mm/vmscan.c | 20 +++++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff -puN mm/Kconfig~swap-migration-add-config_migration-for-page-migration-support-tweaks mm/Kconfig --- devel/mm/Kconfig~swap-migration-add-config_migration-for-page-migration-support-tweaks 2005-11-22 22:30:27.000000000 -0800 +++ devel-akpm/mm/Kconfig 2005-11-22 22:30:27.000000000 -0800 @@ -138,5 +138,4 @@ config SPLIT_PTLOCK_CPUS # config MIGRATION def_bool y if NUMA || SPARSEMEM || DISCONTIGMEM - - + depends on SWAP diff -puN mm/vmscan.c~swap-migration-add-config_migration-for-page-migration-support-tweaks mm/vmscan.c --- devel/mm/vmscan.c~swap-migration-add-config_migration-for-page-migration-support-tweaks 2005-11-22 22:30:27.000000000 -0800 +++ devel-akpm/mm/vmscan.c 2005-11-22 22:30:27.000000000 -0800 @@ -666,8 +666,9 @@ redo: /* * Skip locked pages during the first two passes to give the - * functions holding the lock time to release the page. Later we use - * lock_page to have a higher chance of acquiring the lock. + * functions holding the lock time to release the page. Later we + * use lock_page() to have a higher chance of acquiring the + * lock. */ if (pass > 2) lock_page(page); @@ -679,15 +680,15 @@ redo: * Only wait on writeback if we have already done a pass where * we we may have triggered writeouts for lots of pages. */ - if (pass > 0) + if (pass > 0) { wait_on_page_writeback(page); - else + } else { if (PageWriteback(page)) { unlock_page(page); goto retry_later; } + } -#ifdef CONFIG_SWAP if (PageAnon(page) && !PageSwapCache(page)) { if (!add_to_swap(page)) { unlock_page(page); @@ -696,16 +697,15 @@ redo: continue; } } -#endif /* CONFIG_SWAP */ /* * Page is properly locked and writeback is complete. * Try to migrate the page. */ - if (swap_page(page)) { + if (!swap_page(page)) + continue; retry_later: - retry++; - } + retry++; } if (retry && pass++ < 10) goto redo; @@ -767,12 +767,10 @@ static int isolate_lru_pages(int nr_to_s return nr_taken; } -#ifdef CONFIG_SMP static void lru_add_drain_per_cpu(void *dummy) { lru_add_drain(); } -#endif /* * Isolate one page from the LRU lists and put it on the _