linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* question about max_readahead for ide devices in 2.4?
@ 2003-12-15 22:44 John Salmon
  2003-12-16  6:39 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: John Salmon @ 2003-12-15 22:44 UTC (permalink / raw)
  To: linux-kernel



Several "tuning" recommendations suggest that sequential accesses of
large files, and hence the performance of busy web servers, can be improved
by changing the maximum readahead value with, e.g.,

echo 511 > /proc/sys/vm/max-readahead

But it looks to me like get_max_readahead in filemap.c ignores the
value set by /proc/sys in favor of max_readahead[major][minor] whenever
max_readahead[major] is non-NULL.  And furthermore that 
max_readahead[major] IS initialized to non-NULL for ide devices in
init_gendisk.  (N.B. I'm looking at 2.4 sources).

Conclusion: echoing a value into /proc/sys/vm/max-readahead won't change the
readahead behavior for already-probed IDE devices.

Is this correct, or am I missing something?

Thanks,
John Salmon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: question about max_readahead for ide devices in 2.4?
  2003-12-15 22:44 question about max_readahead for ide devices in 2.4? John Salmon
@ 2003-12-16  6:39 ` Andrew Morton
  2003-12-17 22:43   ` John Salmon
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2003-12-16  6:39 UTC (permalink / raw)
  To: John Salmon; +Cc: linux-kernel

John Salmon <jsalmon@thesalmons.org> wrote:
>
> 
> 
> Several "tuning" recommendations suggest that sequential accesses of
> large files, and hence the performance of busy web servers, can be improved
> by changing the maximum readahead value with, e.g.,
> 
> echo 511 > /proc/sys/vm/max-readahead
> 
> But it looks to me like get_max_readahead in filemap.c ignores the
> value set by /proc/sys in favor of max_readahead[major][minor] whenever
> max_readahead[major] is non-NULL.  And furthermore that 
> max_readahead[major] IS initialized to non-NULL for ide devices in
> init_gendisk.  (N.B. I'm looking at 2.4 sources).
> 
> Conclusion: echoing a value into /proc/sys/vm/max-readahead won't change the
> readahead behavior for already-probed IDE devices.
> 
> Is this correct, or am I missing something?

That's correct - it's all a bit weird.   You should use

	blockdev --setra 511 /dev/hda

for IDE devices.  Not sure about scsi.  You may as well set
/proc/sys/vm/max-readahead to the same thing.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: question about max_readahead for ide devices in 2.4?
  2003-12-16  6:39 ` Andrew Morton
@ 2003-12-17 22:43   ` John Salmon
  0 siblings, 0 replies; 3+ messages in thread
From: John Salmon @ 2003-12-17 22:43 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

>>>>> "Andrew" == Andrew Morton <akpm@osdl.org> writes:

Andrew> John Salmon <jsalmon@thesalmons.org> wrote:
>> 
>> 
>> 
>> Several "tuning" recommendations suggest that sequential accesses of
>> large files, and hence the performance of busy web servers, can be improved
>> by changing the maximum readahead value with, e.g.,
>> 
>> echo 511 > /proc/sys/vm/max-readahead
>> 
>> But it looks to me like get_max_readahead in filemap.c ignores the
>> value set by /proc/sys in favor of max_readahead[major][minor] whenever
>> max_readahead[major] is non-NULL.  And furthermore that 
>> max_readahead[major] IS initialized to non-NULL for ide devices in
>> init_gendisk.  (N.B. I'm looking at 2.4 sources).
>> 
>> Conclusion: echoing a value into /proc/sys/vm/max-readahead won't change the
>> readahead behavior for already-probed IDE devices.
>> 
>> Is this correct, or am I missing something?

Andrew> That's correct - it's all a bit weird.   You should use

Andrew> 	blockdev --setra 511 /dev/hda

Andrew> for IDE devices.  Not sure about scsi.  You may as well set
Andrew> /proc/sys/vm/max-readahead to the same thing.

Are you sure?  It looks like that invokes the BLKRASET ioctl, which
sets an entry in the read_ahead[MAJOR(dev)] array.  But the only code
that uses the read_ahead[] array is in fs/hfs/file.c, and I'm definitely
not using an hfs filesystem.

Or am I missing something else??

Thanks,
John Salmon

P.S.  The weird thing is that I tried the blockdev --setra suggestoin
and it *seemed to* improve performance.  This is why drug tests are
double-blind ... the patient (the computer) may not be susceptible to
the placebo effect, but the doctor (me) may be :-(.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-12-17 22:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-15 22:44 question about max_readahead for ide devices in 2.4? John Salmon
2003-12-16  6:39 ` Andrew Morton
2003-12-17 22:43   ` John Salmon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).