From: Jens Axboe <jens.axboe@oracle.com>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Chris Mason <chris.mason@oracle.com>,
Lars Ellenberg <lars.ellenberg@linbit.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"dm-devel@redhat.com" <dm-devel@redhat.com>,
Neil Brown <neilb@suse.de>,
"Van De Ven, Arjan" <arjan.van.de.ven@intel.com>
Subject: Re: Why does __do_page_cache_readahead submit READ, not READA?
Date: Mon, 3 Aug 2009 11:37:53 +0200 [thread overview]
Message-ID: <20090803093753.GL12579@kernel.dk> (raw)
In-Reply-To: <20090803093426.GA25139@localhost>
On Mon, Aug 03 2009, Wu Fengguang wrote:
> On Mon, Aug 03, 2009 at 05:25:15PM +0800, Jens Axboe wrote:
> > On Mon, Aug 03 2009, Wu Fengguang wrote:
> > > On Mon, Aug 03, 2009 at 03:59:33PM +0800, Jens Axboe wrote:
> > > > On Mon, Aug 03 2009, Wu Fengguang wrote:
> > > > > On Thu, Jul 30, 2009 at 08:06:49AM +0200, Jens Axboe wrote:
> > > > > > > > read at that level. I did some experimentation some time ago for
> > > > > > > > flagging this, see:
> > > > > > > >
> > > > > > > > http://git.kernel.dk/?p=linux-2.6-block.git;a=commitdiff;h=16cfe64e3568cda412b3cf6b7b891331946b595e
> > > > > > > >
> > > > > > > > which should pass down READA properly.
> > > > > > >
> > > > > > > One of the problems in the past was that reada would fail if there
> > > > > > > wasn't a free request when we actually wanted it to go ahead and wait.
> > > > > > > Or something. We've switched it around a few times I think.
> > > > > >
> > > > > > Yes, we did used to do that, whether it was 2.2 or 2.4 I
> > > > > > don't recall :-)
> > > > > >
> > > > > > It should be safe to enable know, whether there's a prettier way
> > > > > > than the above, I don't know. It works by detecting the read-ahead
> > > > > > marker, but it's a bit of a fragile design.
> > > > >
> > > > > Another consideration is io-priority reversion and the overheads
> > > > > required to avoid it:
> > > > >
> > > > > readahead(pages A-Z) => READA IO for pages A-Z
> > > > > <short time later>
> > > > > read(page A) => blocked => find the request that contains page A
> > > > > and requeue/kick it as READ IO
> > > > >
> > > > > The page-to-request lookups are not always required but nevertheless
> > > > > the complexity and overheads won't be trivial.
> > > > >
> > > > > The page-to-request lookup feature would be also useful for "advanced"
> > > > > features like io-canceling (if implemented, hwpoison could be its
> > > > > first user ;)
> > > >
> > > > I added that 3-4 years ago or so, to experiment with in-kernel
> > > > cancellation for things like truncate(). Tracking pages is not cheap,
> > > > and since the write cancelling wasn't really very sucessful, I didn't go
> > > > ahead with it.
> > >
> > > Ah OK.
> > >
> > > > So I'm not sure it's a viable alternative, even if we restricted it to
> > > > just tracking READA's, for instance.
> > >
> > > Kind of agreed. I guess it won't benefit too much workloads to default
> > > to READA; for most workloads it would be pure overheads if considering
> > > priority inversion.
> > >
> > > > But I don't think we have any priority inversion to worry about, at
> > > > least not from the CFQ perspective.
> > >
> > > The priority inversion problem showed up in an early attempt to do
> > > boot time prefetching. I guess this problem was somehow circumvented
> > > by limiting the prefetch depth and do prefetches in original read
> > > order instead of disk location order (Arjan cc'ed).
> >
> > But was that not due to the prefetcher running at a lower cpu priority?
>
> Yes, it is. Thus the priority inversion problem.
>
> > Just flagging a reada hint will not change your priority in the IO
> > scheduler, so we should have no priority inversion there.
>
> Ah OK. So READA merely means "don't try hard on error" for now.
> Sorry I implicitly associated it with some priority class..
Well not necessarily, it could also have some priority implications in
the scheduler. My point is just that it need not be severe enough to
introduce priority inversions, so that we need a specific tracking
framework to graduate READA to READ.
--
Jens Axboe
--
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-08-03 9:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-29 16:14 Why does __do_page_cache_readahead submit READ, not READA? Lars Ellenberg
2009-07-29 21:18 ` Jens Axboe
2009-07-29 22:55 ` Chris Mason
2009-07-30 6:06 ` Jens Axboe
2009-07-30 14:34 ` Chris Mason
2009-07-30 16:47 ` Jeff Moyer
2009-07-30 16:56 ` Chris Mason
2009-08-03 7:52 ` Wu Fengguang
2009-08-03 7:59 ` Jens Axboe
2009-08-03 8:23 ` Wu Fengguang
2009-08-03 9:25 ` Jens Axboe
2009-08-03 9:34 ` Wu Fengguang
2009-08-03 9:37 ` Jens Axboe [this message]
2009-08-03 9:44 ` Wu Fengguang
2009-08-03 14:26 ` [dm-devel] " James Bottomley
2009-08-03 21:03 ` 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=20090803093753.GL12579@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=arjan.van.de.ven@intel.com \
--cc=chris.mason@oracle.com \
--cc=dm-devel@redhat.com \
--cc=fengguang.wu@intel.com \
--cc=lars.ellenberg@linbit.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=neilb@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).