2007-01-27 08:24:27

by Wu Fengguang

[permalink] [raw]
Subject: [PATCH 1/8] readahead: min/max sizes: increase VM_MIN_READAHEAD to 32KB

Use a minimal readahead size of 32KB instead of 16KB for the adaptive readahead.

The potential benefit(disk utilization in worst case doubles) is large, while
the potential panelty is small(wastes up to 32MB when thrashed/missed 1000 times).

This minimal value is only applied for sequential streams.

Signed-off-by: Fengguang Wu <[email protected]>
---
include/linux/mm.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.20-rc4-mm1.orig/include/linux/mm.h
+++ linux-2.6.20-rc4-mm1/include/linux/mm.h
@@ -1069,10 +1069,11 @@ int write_one_page(struct page *page, in
/* readahead.c */
#ifdef CONFIG_ADAPTIVE_READAHEAD
#define VM_MAX_READAHEAD 1024 /* kbytes */
+#define VM_MIN_READAHEAD 32 /* kbytes (includes current page) */
#else
#define VM_MAX_READAHEAD 128 /* kbytes */
-#endif
#define VM_MIN_READAHEAD 16 /* kbytes (includes current page) */
+#endif
#define VM_MAX_CACHE_HIT 256 /* max pages in a row in cache before
* turning readahead off */


--