From: Vivek Goyal <vgoyal@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
"Myklebust, Trond" <Trond.Myklebust@netapp.com>,
linux-fsdevel@vger.kernel.org,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: write-behind on streaming writes
Date: Tue, 5 Jun 2012 13:18:51 -0400 [thread overview]
Message-ID: <20120605171851.GA28556@redhat.com> (raw)
In-Reply-To: <20120605010148.GE4347@dastard>
On Tue, Jun 05, 2012 at 11:01:48AM +1000, Dave Chinner wrote:
> On Wed, May 30, 2012 at 11:21:29AM +0800, Fengguang Wu wrote:
> > Linus,
> >
> > On Tue, May 29, 2012 at 10:35:46AM -0700, Linus Torvalds wrote:
> > > On Tue, May 29, 2012 at 8:57 AM, Fengguang Wu <fengguang.wu@intel.com> wrote:
> > > I just suspect that we'd be better off teaching upper levels about the
> > > streaming. I know for a fact that if I do it by hand, system
> > > responsiveness was *much* better, and IO throughput didn't go down at
> > > all.
> >
> > Your observation of better responsiveness may well be stemmed from
> > these two aspects:
> >
> > 1) lower dirty/writeback pages
> > 2) the async write IO queue being drained constantly
> >
> > (1) is obvious. For a mem=4G desktop, the default dirty limit can be
> > up to (4096 * 20% = 819MB). While your smart writer effectively limits
> > dirty/writeback pages to a dramatically lower 16MB.
> >
> > (2) comes from the use of _WAIT_ flags in
> >
> > sync_file_range(..., SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE|SYNC_FILE_RANGE_WAIT_AFTER);
> >
> > Each sync_file_range() syscall will submit 8MB write IO and wait for
> > completion. That means the async write IO queue constantly swing
> > between 0 and 8MB fillness at the frequency (100MBps / 8MB = 12.5ms).
> > So on every 12.5ms, the async IO queue runs empty, which gives any
> > pending read IO (from firefox etc.) a chance to be serviced. Nice
> > and sweet breaks!
> >
> > I suspect (2) contributes *much more* than (1) to desktop responsiveness.
>
> Almost certainly, especially with NCQ devices where even if the IO
> scheduler preempts the write queue immediately, the device might
> complete the outstanding 31 writes before servicing the read which
> is issued as the 32nd command....
CFQ does preempt async IO once sync IO gets queued.
>
> So NCQ depth is going to play a part here as well.
Yes NCQ depth does contribute primarily to READ latencies in presence of
async IO. I think disk drivers and disk firmware should also participate in
prioritizing READs over pending WRITEs to improve the situation.
IO scheduler can only do so much. CFQ already tries hard to keep pending
async queue depth low and that results in lower throughput many a times
(as compared to deadline).
In fact CFQ tries so hard to prioritize SYNC IO over async IO, that I have
often heard cases of WRITEs being starved and people facing "task blocked
for 120 second warnings".
Thanks
Vivek
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-06-05 17:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120528114124.GA6813@localhost>
[not found] ` <CA+55aFxHt8q8+jQDuoaK=hObX+73iSBTa4bBWodCX3s-y4Q1GQ@mail.gmail.com>
2012-05-29 15:57 ` write-behind on streaming writes Fengguang Wu
2012-05-29 17:35 ` Linus Torvalds
2012-05-30 3:21 ` Fengguang Wu
2012-06-05 1:01 ` Dave Chinner
2012-06-05 17:18 ` Vivek Goyal [this message]
2012-06-05 17:23 ` Vivek Goyal
2012-06-05 17:41 ` Vivek Goyal
2012-06-05 18:48 ` Vivek Goyal
2012-06-05 20:10 ` Vivek Goyal
2012-06-06 2:57 ` Vivek Goyal
2012-06-06 3:14 ` Linus Torvalds
2012-06-06 12:14 ` Vivek Goyal
2012-06-06 14:00 ` Fengguang Wu
2012-06-06 17:04 ` Vivek Goyal
2012-06-07 9:45 ` Jan Kara
2012-06-07 19:06 ` Vivek Goyal
2012-06-06 16:15 ` Vivek Goyal
2012-06-06 14:08 ` Fengguang Wu
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=20120605171851.GA28556@redhat.com \
--to=vgoyal@redhat.com \
--cc=Trond.Myklebust@netapp.com \
--cc=david@fromorbit.com \
--cc=fengguang.wu@intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=torvalds@linux-foundation.org \
/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).