[PATCH 3/4] SwapMig: Drop unused pages immediately

From: Christoph Lameter
Date: Thu Nov 17 2005 - 20:03:25 EST


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 <clameter@xxxxxxx>

Index: linux-2.6.15-rc1-mm1/mm/vmscan.c
===================================================================
--- linux-2.6.15-rc1-mm1.orig/mm/vmscan.c 2005-11-17 15:59:07.000000000 -0800
+++ linux-2.6.15-rc1-mm1/mm/vmscan.c 2005-11-17 16:05:18.000000000 -0800
@@ -700,6 +700,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
-
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/