From: Christoph Lameter Drop unused pages immediately If a page is encountered that is only referenced by the migration code then there is no reason to swap or migrate the page. Release the page by calling move_to_lru(). Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton --- mm/vmscan.c | 5 +++++ 1 files changed, 5 insertions(+) diff -puN mm/vmscan.c~swapmig-drop-unused-pages-immediately mm/vmscan.c --- devel/mm/vmscan.c~swapmig-drop-unused-pages-immediately 2005-12-22 05:08:55.000000000 -0800 +++ devel-akpm/mm/vmscan.c 2005-12-22 05:08:55.000000000 -0800 @@ -689,6 +689,11 @@ redo: list_for_each_entry_safe(page, page2, l, lru) { cond_resched(); + if (page_count(page) == 1) { + /* page was freed from under us. So we are done. */ + move_to_lru(page); + continue; + } /* * Skip locked pages during the first two passes to give the * functions holding the lock time to release the page. Later we _