aboutsummaryrefslogtreecommitdiffstats
path: root/mm/readahead.c
diff options
context:
space:
mode:
authorSteven Pratt <slpratt@austin.ibm.com>2006-03-22 03:08:48 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-22 10:54:03 -0500
commitaed75ff3caafce404d9be7f0c088716375be5279 (patch)
tree15e7165969ff533b73e29a4ee0d4b7c889ef1d29 /mm/readahead.c
parenta564da3964db3256069190c2ae95069143ac37fb (diff)
[PATCH] readahead: fix initial window size calculation
The current current get_init_ra_size is not optimal across different IO sizes and max_readahead values. Here is a quick summary of sizes computed under current design and under the attached patch. All of these assume 1st IO at offset 0, or 1st detected sequential IO. 32k max, 4k request old new ----------------- 8k 8k 16k 16k 32k 32k 128k max, 4k request old new ----------------- 32k 16k 64k 32k 128k 64k 128k 128k 128k max, 32k request old new ----------------- 32k 64k <----- 64k 128k 128k 128k 512k max, 4k request old new ----------------- 4k 32k <---- 16k 64k 64k 128k 128k 256k 512k 512k Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc: Steven Pratt <slpratt@austin.ibm.com> Cc: Ram Pai <linuxram@us.ibm.com> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/readahead.c')
-rw-r--r--mm/readahead.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/readahead.c b/mm/readahead.c
index 57557e294987..301b36c4a0ce 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -83,10 +83,10 @@ static unsigned long get_init_ra_size(unsigned long size, unsigned long max)
83{ 83{
84 unsigned long newsize = roundup_pow_of_two(size); 84 unsigned long newsize = roundup_pow_of_two(size);
85 85
86 if (newsize <= max / 64) 86 if (newsize <= max / 32)
87 newsize = newsize * newsize; 87 newsize = newsize * 4;
88 else if (newsize <= max / 4) 88 else if (newsize <= max / 4)
89 newsize = max / 4; 89 newsize = newsize * 2;
90 else 90 else
91 newsize = max; 91 newsize = max;
92 return newsize; 92 return newsize;