[RFC:PATCH 07/07] shrink_active_list: pack file tails rather than move to inactive list

Dave Kleikamp
2007-08-29T20:55:29Z

The big question is how aggressively we pack the tails. This looked like
an easy place to start. If a page is being moved from the active list to
the inactive list, and the tail can be safely packed, that is not mapped,
not dirty, etc., the tail is packed and the page removed from the page
cache.

Right now, pages that never get off the inactive list will not be packed.

I will be soliciting ideas for other places in the code where tails can
be packed. One of my goals is not to be too aggressive, where tails are
packed and unpacked repeatedly. I also don't want to add too much overhead,
such as an extra scan of the inactive list.

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
---

mm/vmscan.c | 6 ++++++
1 file changed, 6 insertions(+)

diff -Nurp linux006/mm/vmscan.c linux007/mm/vmscan.c
--- linux006/mm/vmscan.c 2007-08-28 09:57:20.000000000 -0500
+++ linux007/mm/vmscan.c 2007-08-29 13:27:46.000000000 -0500
@@ -19,6 +19,7 @@
#include <linux/pagemap.h>
#include <linux/init.h>
#include <linux/highmem.h>
+#include <linux/vm_file_tail.h>
#include <linux/vmstat.h>
#include <linux/file.h>
#include <linux/writeback.h>
@@ -994,7 +995,12 @@ force_reclaim_mapped:
list_add(&page->lru, &l_active);
continue;
}
+ } else if (vm_file_tail_pack(page)) {
+ ClearPageActive(page);
+ page_cache_release(page);
+ continue;
}
+
list_add(&page->lru, &l_inactive);
}