From: Jeff Moyer <jmoyer@redhat.com>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Vladislav Bolkhovitin <vst@vlnb.net>,
Jens Axboe <jens.axboe@oracle.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] readahead: introduce context readahead algorithm
Date: Tue, 14 Apr 2009 23:43:32 -0400 [thread overview]
Message-ID: <x49k55mintn.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <20090412072052.686760755@intel.com> (Wu Fengguang's message of "Sun, 12 Apr 2009 15:19:53 +0800")
Wu Fengguang <fengguang.wu@intel.com> writes:
> Introduce page cache context based readahead algorithm.
> This is to better support concurrent read streams in general.
>
> RATIONALE
> ---------
> The current readahead algorithm detects interleaved reads in a _passive_ way.
> Given a sequence of interleaved streams 1,1001,2,1002,3,4,1003,5,1004,1005,6,...
> By checking for (offset == prev_offset + 1), it will discover the sequentialness
> between 3,4 and between 1004,1005, and start doing sequential readahead for the
> individual streams since page 4 and page 1005.
>
> The context readahead algorithm guarantees to discover the sequentialness no
> matter how the streams are interleaved. For the above example, it will start
> sequential readahead since page 2 and 1002.
>
> The trick is to poke for page @offset-1 in the page cache when it has no other
> clues on the sequentialness of request @offset: if the current requenst belongs
> to a sequential stream, that stream must have accessed page @offset-1 recently,
> and the page will still be cached now. So if page @offset-1 is there, we can
> take request @offset as a sequential access.
>
> BENEFICIARIES
> -------------
> - strictly interleaved reads i.e. 1,1001,2,1002,3,1003,...
> the current readahead will take them as silly random reads;
> the context readahead will take them as two sequential streams.
>
> - cooperative IO processes i.e. NFS and SCST
> They create a thread pool, farming off (sequential) IO requests to different
> threads which will be performing interleaved IO.
>
> It was not easy(or possible) to reliably tell from file->f_ra all those
> cooperative processes working on the same sequential stream, since they will
> have different file->f_ra instances. And NFSD's file->f_ra is particularly
> unusable, since their file objects are dynamically created for each request.
> The nfsd does have code trying to restore the f_ra bits, but not satisfactory.
Hi, Wu,
I tested out your patches. Below are some basic iozone numbers for a
single NFS client reading a file. The iozone command line is:
iozone -s 2000000 -r 64 -f /mnt/test/testfile -i 1 -w
The file system is unmounted after each run to flush the cache. The
numbers below reflect only a single run each. The file system was also
unmounted on the NFS client after each run.
KEY
---
vanilla: 2.6.30-rc1
readahead: 2.6.30-rc1 + your 10 readahead patches
context readahead: 2.6.30-rc1 + your 10 readahead patches + the 3
context readahead patches.
nfsd's: number of NFSD threads on the server
I'll note that the cfq in 2.6.30-rc1 is crippled, and that Jens has a
patch posted that makes the numbers look at least a little better, but
that's immaterial to this discussion, I think.
vanilla
nfsd's | 1 | 2 | 4 | 8
--------+---------------+-------+------
cfq | 43127 | 22354 | 20858 | 21179
deadline| 43732 | 68059 | 76659 | 83231
readahead
nfsd's | 1 | 2 | 4 | 8
--------+---------------+-------+------
cfq | 42471 | 21913 | 21252 | 20979
deadline| 42801 | 70158 | 82068 | 82406
context readahead
nfsd's | 1 | 2 | 4 | 8
--------+---------------+-------+------
cfq | 42827 | 21882 | 20678 | 21508
deadline| 43040 | 71173 | 82407 | 86583
Cheers,
Jeff
next prev parent reply other threads:[~2009-04-15 3:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-12 7:19 [PATCH 0/3] context readahead for concurrent IO take 2 Wu Fengguang
2009-04-12 7:19 ` [PATCH 1/3] radix-tree: add radix_tree_prev_hole() Wu Fengguang
2009-04-12 17:29 ` Andrew Morton
2009-04-13 13:44 ` Wu Fengguang
2009-04-12 7:19 ` [PATCH 2/3] readahead: move the random read case to bottom Wu Fengguang
2009-04-12 7:19 ` [PATCH 3/3] readahead: introduce context readahead algorithm Wu Fengguang
2009-04-12 8:48 ` Ingo Molnar
2009-04-12 12:35 ` Wu Fengguang
2009-04-16 17:12 ` Vladislav Bolkhovitin
2009-04-15 3:43 ` Jeff Moyer [this message]
2009-04-15 4:43 ` Wu Fengguang
2009-04-15 17:55 ` Jeff Moyer
2009-04-27 4:48 ` Wu Fengguang
-- strict thread matches above, loose matches on Subject: below --
2009-04-10 13:12 [PATCH 0/3] context readahead for concurrent IO Wu Fengguang
2009-04-10 13:12 ` [PATCH 3/3] readahead: introduce context readahead algorithm Wu Fengguang
2009-04-11 0:16 ` Andrew Morton
2009-04-12 7: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=x49k55mintn.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vst@vlnb.net \
/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
Powered by JetHome