summaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2006-01-08 10:00:54 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-09 05:12:42 +0100
commitee27497df36823f2793212cad0997c044eb0e1eb (patch)
tree854dded3b0277b0962b3c9a39c9cdb446654154b /mm/vmscan.c
parent[PATCH] SwapMig: add_to_swap() avoid atomic allocations (diff)
downloadlinux-ee27497df36823f2793212cad0997c044eb0e1eb.tar.xz
linux-ee27497df36823f2793212cad0997c044eb0e1eb.zip
[PATCH] SwapMig: Drop unused pages immediately
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@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 5393b093a87b..73ba4046ed27 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -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