public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John Salmon <jsalmon@thesalmons.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: question about max_readahead for ide devices in 2.4?
Date: Wed, 17 Dec 2003 14:43:42 -0800	[thread overview]
Message-ID: <m3iskfm5ep.fsf@river.fishnet> (raw)
In-Reply-To: <20031215223903.19687b79.akpm@osdl.org> (Andrew Morton's message of "Mon, 15 Dec 2003 22:39:03 -0800")

>>>>> "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 :-(.



      reply	other threads:[~2003-12-17 22:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3iskfm5ep.fsf@river.fishnet \
    --to=jsalmon@thesalmons.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox