[RFC:PATCH 06/07] For readahead, leave data in tail

Dave Kleikamp
2007-08-29T20:54:00Z

For readahead, leave data in tail

Don't unpack it until it's actually read.

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

mm/readahead.c | 5 +++++
1 file changed, 5 insertions(+)

diff -Nurp linux005/mm/readahead.c linux006/mm/readahead.c
--- linux005/mm/readahead.c 2007-08-28 09:57:20.000000000 -0500
+++ linux006/mm/readahead.c 2007-08-29 13:27:46.000000000 -0500
@@ -15,6 +15,7 @@
#include <linux/backing-dev.h>
#include <linux/task_io_accounting_ops.h>
#include <linux/pagevec.h>
+#include <linux/vm_file_tail.h>

void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page)
{
@@ -163,6 +164,10 @@ __do_page_cache_readahead(struct address
if (page_offset > end_index)
break;

+ if ((page_offset == end_index) && vm_file_tail_packed(mapping))
+ /* Tail page is already packed */
+ break;
+
page = radix_tree_lookup(&mapping->page_tree, page_offset);
if (page)
continue;