From: Badari Pulavarty <pbadari@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: suparna@in.ibm.com, linux-kernel@vger.kernel.org, linux-aio@kvack.org
Subject: Re: [PATCH][2.6-mm] Readahead issues and AIO read speedup
Date: Thu, 7 Aug 2003 10:21:39 -0700 [thread overview]
Message-ID: <200308071021.39816.pbadari@us.ibm.com> (raw)
In-Reply-To: <20030807092800.58335e84.akpm@osdl.org>
On Thursday 07 August 2003 09:28 am, Andrew Morton wrote:
> Badari Pulavarty <pbadari@us.ibm.com> wrote:
> > I noticed the exact same thing while testing on database benchmark
> > on filesystems (without AIO). I added instrumentation in scsi layer to
> > record the IO pattern and I found that we are doing lots of (4million)
> > 4K reads, in my benchmark run. I was tracing that and found that all
> > those reads are generated by slow read path, since readahead window
> > is maximally shrunk. When I forced the readahead code to read 16k
> > (my database pagesize), in case ra window closed - I see 20% improvement
> > in my benchmark. I asked "Ramchandra Pai" (linuxram@us.ibm.com)
> > to investigate it further.
>
> But if all the file's pages are already in pagecache (a common case)
> this patched kernel will consume extra CPU pointlessly poking away at
> pagecache. Reliably shrinking the window to zero is important for this
> reason.
Yes !! I hardcoded it to 16k, since I know that all my reads will be 16k
(atleast). We should do readahead of actual pages required by the current
read would be correct solution. (like Suparna suggested).
>
> If the database pagesize is 16k then the application should be submitting
> 16k reads, yes?
Yes. Database always does IO in atleast 16k (in my case).
> If so then these should not be creating 4k requests at the
> device layer! So what we need to do is to ensure that at least those 16k
> worth of pages are submitted in a single chunk. Without blowing CPU if
> everything is cached. Tricky. I'll take a look at what's going on.
When readahead window is closed, slow read code will be submitting IO in 4k
chunks. Infact, it will wait for the IO to finish, before reading next page.
Isn't it ? How would you ensure atleast 16k worth of pages are submitted
in a sinle chunk here ?
I am hoping that forcing readhead code to read pages needed by current read
would address this problem.
> Another relevant constraint here (and there are lots of subtle constraints
> in readahead) is that often database files are fragmented all over the
> disk, because they were laid out that way (depends on the database and
> how it was set up). In this case, any extra readahead is a disaster
> because it incurs extra seeks, needlessly.
Agreed. In my case, I made sure that all the files are almost contiguous.
(I put one file per filesystem - and verified thro debugfs).
Thanks,
Badari
next prev parent reply other threads:[~2003-08-07 17:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-07 10:01 [PATCH][2.6-mm] Readahead issues and AIO read speedup Suparna Bhattacharya
2003-08-07 16:01 ` Badari Pulavarty
2003-08-07 16:28 ` Andrew Morton
2003-08-07 17:21 ` Badari Pulavarty [this message]
2003-08-07 17:39 ` Andrew Morton
2003-08-07 20:41 ` Badari Pulavarty
2003-08-07 20:58 ` Andrew Morton
2003-08-08 13:56 ` Suparna Bhattacharya
2003-08-13 21:06 ` Ram Pai
2003-09-23 0:41 ` Ram Pai
2003-08-07 19:36 ` Joel Becker
2003-08-08 5:42 ` Jens Axboe
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=200308071021.39816.pbadari@us.ibm.com \
--to=pbadari@us.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-aio@kvack.org \
--cc=linux-kernel@vger.kernel.org \
--cc=suparna@in.ibm.com \
/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