lkml.org 
[lkml]   [2006]   [Jun]   [9]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateFri, 09 Jun 2006 16:08:02 +0800
FromWu Fengguang <>
Subject[PATCH 1/5] readahead: no RA_FLAG_EOF on single page file
Dot not set RA_FLAG_EOF on single page files.

readahead_close() will be called if RA_FLAG_EOF is there on file close.
It detects readahead hit/miss, and adjust ra_expected_bytes correspondingly.
Single page files are uninteresting for it. Since near 40% desktop
files are <= 4k, this patch can reduce many useless readahead_close()
invocations.

Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn>
---

--- linux-2.6.17-rc5-mm3.orig/mm/readahead.c
+++ linux-2.6.17-rc5-mm3/mm/readahead.c
@@ -1037,7 +1037,8 @@ static int ra_dispatch(struct file_ra_st
 		ra->readahead_index = eof_index;
 		if (ra->lookahead_index > eof_index)
 			ra->lookahead_index = eof_index;
-		ra->flags |= RA_FLAG_EOF;
+		if (eof_index > 1)
+			ra->flags |= RA_FLAG_EOF;
 	}
 
 	/* Disable look-ahead for loopback file. */
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-09 10:14    [from the cache]
©2003-2008