Re: Readahead algorithm problems again...

From: Steven Pratt
Date: Fri Aug 12 2005 - 14:12:25 EST


This is a multi-part message in MIME format.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


Steve

--- linux-2.6.12/mm/readahead.org.c 2005-08-01 08:52:12.000000000 -0500
+++ linux-2.6.12/mm/readahead.c 2005-08-10 10:16:52.000000000 -0500
@@ -72,10 +72,10 @@ static unsigned long get_init_ra_size(un
{
unsigned long newsize = roundup_pow_of_two(size);

- if (newsize <= max / 64)
- newsize = newsize * newsize;
+ if (newsize <= max / 32)
+ newsize = newsize * 4;
else if (newsize <= max / 4)
- newsize = max / 4;
+ newsize = newsize * 2;
else
newsize = max;
return newsize;

------------------------------------------------------------------------------

Oleg.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/