From: Wu Fengguang <fengguang.wu@intel.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Vladislav Bolkhovitin <vst@vlnb.net>,
Jens Axboe <jens.axboe@oracle.com>,
Jeff Moyer <jmoyer@redhat.com>, Nick Piggin <npiggin@suse.de>,
Ingo Molnar <mingo@elte.hu>,
Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Chenfeng Xu <xcf@ustc.edu.cn>
Subject: Re: [PATCH 3/3] readahead: introduce context readahead algorithm
Date: Tue, 14 Apr 2009 18:58:24 +0800 [thread overview]
Message-ID: <20090414105824.GA8628@localhost> (raw)
In-Reply-To: <20090414100002.GW14687@one.firstfloor.org>
On Tue, Apr 14, 2009 at 06:00:02PM +0800, Andi Kleen wrote:
> > I'll list some possible situations. I guess you are referring to (2.3)?
>
> Yep. Thanks for the detailed analysis.
You are welcome :-)
> > 2.3) readahead cache hits: rare case and the impact is temporary
> >
> > The page at @offset-1 does get referenced by this stream, but it's
> > created by someone else at some distant time ago. The page at
> > @offset-1 may be lifted to active lru by this second reference, or too
> > late and get reclaimed - by the time we reference page @offset.
> >
> > Normally its a range of cached pages. We are a) either walking inside the
> > range and enjoying the cache hits, b) or we walk out of it and restart
> > readahead by ourself, c) or the range of cached pages get reclaimed
> > while we are walking on them, and hence cannot find page @offset-1.
> >
> > Obviously (c) is rare and temporary and is the main cause of (2.3).
> > As soon as we goto the next page at @offset+1, we'll its 'previous'
> > page at @offset to be cached(it is created by us!). So the context
> > readahead starts working again - it's merely delayed by one page :-)
>
> Thanks. The question is how much performance impact this has on
> the stream that is readaheaded. I guess it would be only a smaller
> "hickup", with some luck hidden by the block level RA?
Yes there will be hickup: whenever the stream walks out of the current
cached page range(or the pages get reclaimed while we are walking in it),
there will be a 1-page read, followed by a 4-page readahead, and then 8,
16, ... page sized readahead, i.e. a readahead window rampup process.
That's assuming we are doing 1-page reads. For large sendfile() calls,
the readahead size will be instantly restored to its full size on the
first cache miss.
> The other question would be if it could cause the readahead code
> to do a lot of unnecessary work, but your answer seems to be "no". Fine.
Right. The readahead will automatically be turned off inside the
cached page ranges, and restarted after walking out of it.
> I think the concept is sound.
^_^ Thanks for your appreciation!
Best Regards,
Fengguang
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-04-14 10:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20090412071950.166891982@intel.com>
[not found] ` <20090412072052.686760755@intel.com>
[not found] ` <20090412084819.GA25314@elte.hu>
2009-04-12 12:35 ` Wu Fengguang
2009-04-16 17:12 ` Vladislav Bolkhovitin
[not found] ` <87zlej7kwf.fsf@basil.nowhere.org>
2009-04-14 9:27 ` Wu Fengguang
2009-04-14 10:00 ` Andi Kleen
2009-04-14 10:58 ` Wu Fengguang [this message]
2009-04-14 11:11 ` Wu Fengguang
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=20090414105824.GA8628@localhost \
--to=fengguang.wu@intel.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=jens.axboe@oracle.com \
--cc=jmoyer@redhat.com \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
--cc=npiggin@suse.de \
--cc=torvalds@linux-foundation.org \
--cc=vst@vlnb.net \
--cc=xcf@ustc.edu.cn \
/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