Re: [RESEND] [PATCH] readahead:add blk_run_backing_dev

Wu Fengguang
2009-06-06T22:45:55Z

On Sat, Jun 06, 2009 at 10:36:41PM +0800, KOSAKI Motohiro wrote:
>
> sorry for late responce.
> I wonder why I and Wu don't contain Cc list in this thread.

[restore more CC]

> > Hisashi Hifumi wrote:
> > > At 09:36 09/06/01, Andrew Morton wrote:
> > >> On Fri, 29 May 2009 14:35:55 +0900 Hisashi Hifumi
> > >> <hifumi.hisashi@oss.ntt.co.jp> wrote:
> > >>
> > >>> I added blk_run_backing_dev on page_cache_async_readahead
> > >>> so readahead I/O is unpluged to improve throughput on
> > >>> especially RAID environment.
> > >> I skipped the last version of this because KOSAKI Motohiro
> > >> <kosaki.motohiro@jp.fujitsu.com> said "Please attach blktrace analysis ;)".
> > >>
> > >> I'm not sure why he asked for that, but he's a smart chap and
> > >> presumably had his reasons.
> > >>
> > >> If you think that such an analysis is unneeded, or isn't worth the time
> > >> to generate then please tell us that. But please don't just ignore the
> > >> request!
> > >
> > > Hi Andrew.
> > >
> > > Sorry for this.
> > >
> > > I did not ignore KOSAKI Motohiro's request.
> > > I've got blktrace output for both with and without the patch,
> > > but I just did not clarify the reason for throuput improvement
> > > from this result.
> > >
> > > I do not notice any difference except around unplug behavior by dd.
> > > Comments?
> >
> > Pardon my ignorance on the global issues concerning the patch, but
> > specifically looking at the traces generated by blktrace leads one to
> > also note that the patched version may generate inefficiencies in other
> > places in the kernel by reducing the merging going on. In the unpatched
> > version it looks like (generally) that two incoming bio's are able to be
> > merged to generate a single I/O request. In the patched version -
> > because of the quicker unplug(?) - no such merging is going on. This
> > leads to more work lower in the stack (twice as many I/O operations
> > being managed), perhaps increased interrupts & handling &c. [This may be
> > acceptable if the goal is to decrease latencies on a per-bio basis...]
> >
> > Do you have a place where the raw blktrace data can be retrieved for
> > more in-depth analysis?
>
> I think your comment is really adequate. In another thread, Wu Fengguang pointed
> out the same issue.
> I and Wu also wait his analysis.

And do it with a large readahead size :)

Alan, this was my analysis:

: Hifumi, can you help retest with some large readahead size?
:
: Your readahead size (128K) is smaller than your max_sectors_kb (256K),
: so two readahead IO requests get merged into one real IO, that means
: half of the readahead requests are delayed.

ie. two readahead requests get merged and complete together, thus the effective
IO size is doubled but at the same time it becomes completely synchronous IO.

:
: The IO completion size goes down from 512 to 256 sectors:
:
: before patch:
: 8,0 3 177955 50.050313976 0 C R 8724991 + 512 [0]
: 8,0 3 177966 50.053380250 0 C R 8725503 + 512 [0]
: 8,0 3 177977 50.056970395 0 C R 8726015 + 512 [0]
: 8,0 3 177988 50.060326743 0 C R 8726527 + 512 [0]
: 8,0 3 177999 50.063922341 0 C R 8727039 + 512 [0]
:
: after patch:
: 8,0 3 257297 50.000760847 0 C R 9480703 + 256 [0]
: 8,0 3 257306 50.003034240 0 C R 9480959 + 256 [0]
: 8,0 3 257307 50.003076338 0 C R 9481215 + 256 [0]
: 8,0 3 257323 50.004774693 0 C R 9481471 + 256 [0]
: 8,0 3 257332 50.006865854 0 C R 9481727 + 256 [0]

Thanks,
Fengguang