![]() | |||||||||||||
Messages in this thread Patch in this message |
Set ra_expect_bytes and ra_thrash_bytes of default_backing_dev_info to
large numbers.
Large initial values are better, because
- most systems don't have the danger of thrashing
- most small files are read in whole
- they both increase slowly and drop rapidly
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
@@ -32,6 +32,9 @@
* Adaptive read-ahead parameters.
*/
+/* Default max read-ahead size for the initial method. */
+#define INITIAL_RA_PAGES DIV_ROUND_UP(128*1024, PAGE_CACHE_SIZE)
+
/* In laptop mode, poll delayed look-ahead on every ## pages read. */
#define LAPTOP_POLL_INTERVAL 16
@@ -127,9 +130,9 @@ EXPORT_SYMBOL(default_unplug_io_fn);
struct backing_dev_info default_backing_dev_info = {
.ra_pages = MAX_RA_PAGES,
- .ra_pages0 = (128*1024) / PAGE_CACHE_SIZE,
- .ra_expect_bytes = VM_MIN_READAHEAD*1024,
- .ra_thrash_bytes = VM_MIN_READAHEAD*1024,
+ .ra_pages0 = INITIAL_RA_PAGES,
+ .ra_expect_bytes = INITIAL_RA_PAGES * PAGE_CACHE_SIZE,
+ .ra_thrash_bytes = MAX_RA_PAGES * PAGE_CACHE_SIZE,
.state = 0,
.capabilities = BDI_CAP_MAP_COPY,
.unplug_io_fn = default_unplug_io_fn,
--
-
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:15 [from the cache] ©2003-2008 | |||||||||||||