* [PATCH] readahead: fix initial window size calculation
@ 2006-02-26 19:50 Oleg Nesterov
2006-02-27 15:41 ` Steven Pratt
0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2006-02-26 19:50 UTC (permalink / raw)
To: Andrew Morton
Cc: Bryan Fink, linux-kernel, Ram Pai, Steven Pratt, Trond Myklebust
(I hope it is ok to send this patch without Steven's reply)
From: Steven Pratt <slpratt@austin.ibm.com>
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
--- 2.6.16-rc3/mm/readahead.c~ 2006-02-27 00:53:17.881019192 +0300
+++ 2.6.16-rc3/mm/readahead.c 2006-02-27 01:10:39.172718792 +0300
@@ -83,10 +83,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;
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] readahead: fix initial window size calculation
2006-02-26 19:50 [PATCH] readahead: fix initial window size calculation Oleg Nesterov
@ 2006-02-27 15:41 ` Steven Pratt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Pratt @ 2006-02-27 15:41 UTC (permalink / raw)
To: Oleg Nesterov
Cc: Andrew Morton, Bryan Fink, linux-kernel, Ram Pai, Trond Myklebust
Oleg Nesterov wrote:
>(I hope it is ok to send this patch without Steven's reply)
>
>
Yes, It is fine.
>From: Steven Pratt <slpratt@austin.ibm.com>
>
>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
>
>--- 2.6.16-rc3/mm/readahead.c~ 2006-02-27 00:53:17.881019192 +0300
>+++ 2.6.16-rc3/mm/readahead.c 2006-02-27 01:10:39.172718792 +0300
>@@ -83,10 +83,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;
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-02-27 15:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-26 19:50 [PATCH] readahead: fix initial window size calculation Oleg Nesterov
2006-02-27 15:41 ` Steven Pratt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox