From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jan Kara <jack@suse.cz>, Curt Wohlgemuth <curtw@google.com>,
Al Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
fengguang.wu@intel.com
Subject: Re: [PATCH] writeback: Don't wait for completion in writeback_inodes_sb_nr
Date: Wed, 29 Jun 2011 21:15:18 +0200 [thread overview]
Message-ID: <20110629191518.GA23196@quack.suse.cz> (raw)
In-Reply-To: <20110629175534.GA32236@infradead.org>
On Wed 29-06-11 13:55:34, Christoph Hellwig wrote:
> On Wed, Jun 29, 2011 at 06:57:14PM +0200, Jan Kara wrote:
> > > For sys_sync I'm pretty sure we could simply remove the
> > > writeback_inodes_sb call and get just as good if not better performance,
> > Actually, it won't with current code. Because WB_SYNC_ALL writeback
> > currently has the peculiarity that it looks like:
> > for all inodes {
> > write all inode data
> > wait for inode data
> > }
> > while to achieve good performance we actually need something like
> > for all inodes
> > write all inode data
> > for all inodes
> > wait for inode data
> > It makes a difference in an order of magnitude when there are lots of
> > smallish files - SLES had a bug like this so I know from user reports ;)
>
> I don't think that's true. The WB_SYNC_ALL writeback is done using
> sync_inodes_sb, which operates as:
>
> for all dirty inodes in bdi:
> if inode belongs to sb
> write all inode data
>
> for all inodes in sb:
> wait for inode data
>
> we still do that in a big for each sb loop, though.
True but writeback_single_inode() has in it:
if (wbc->sync_mode == WB_SYNC_ALL) {
int err = filemap_fdatawait(mapping);
if (ret == 0)
ret = err;
}
So we end up waiting much earlier. Probably we should remove this wait
but that will need some audit I guess.
> > You mean that sync(1) would actually write the data itself? It would
> > certainly make some things simpler but it has its problems as well - for
> > example sync racing with flusher thread writing back inodes can create
> > rather bad IO pattern...
>
> Only the second pass. The idea is that we first try to use the flusher
> threads for good I/O patterns, but if we can't get that to work only
> block the caller and not everyone. But that's just an idea so far,
> it would need serious benchmark. And despite what I claimed before
> we actually do the wait in the caller context already anyway, which
> already gives you the easy part of the above effect.
Modulo the writeback_single_inode() wait. But if that is dealt with I
agree.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2011-06-29 19:15 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-28 23:43 [PATCH] writeback: Don't wait for completion in writeback_inodes_sb_nr Curt Wohlgemuth
2011-06-29 0:54 ` Dave Chinner
2011-06-29 1:56 ` Curt Wohlgemuth
2011-06-29 8:11 ` Christoph Hellwig
2011-06-29 16:57 ` Jan Kara
2011-06-29 17:55 ` Christoph Hellwig
2011-06-29 19:15 ` Jan Kara [this message]
2011-06-29 20:12 ` Christoph Hellwig
2011-06-30 12:15 ` Jan Kara
2011-06-30 12:37 ` Christoph Hellwig
2011-07-01 22:55 ` Curt Wohlgemuth
2011-07-02 11:32 ` Christoph Hellwig
2011-07-11 17:00 ` Jan Kara
2011-07-11 17:11 ` Curt Wohlgemuth
2011-07-11 19:48 ` Jan Kara
2011-07-11 19:51 ` Curt Wohlgemuth
2011-07-11 20:11 ` Christoph Hellwig
2011-07-12 10:34 ` Jan Kara
2011-07-12 10:41 ` Christoph Hellwig
2011-07-12 22:37 ` Jan Kara
2011-07-14 16:29 ` Curt Wohlgemuth
2011-07-14 23:08 ` Jan Kara
2011-07-19 16:56 ` Christoph Hellwig
2011-07-21 18:35 ` Jan Kara
2011-07-22 15:16 ` Christoph Hellwig
2011-07-19 16:53 ` Christoph Hellwig
2011-07-19 16:51 ` Christoph Hellwig
2011-07-20 22:00 ` Jan Kara
2011-07-22 15:11 ` Christoph Hellwig
2011-06-29 17:26 ` Curt Wohlgemuth
2011-06-29 18:00 ` Christoph Hellwig
2011-06-29 21:30 ` Curt Wohlgemuth
2011-07-19 15:54 ` Christoph Hellwig
2011-06-29 6:42 ` Christoph Hellwig
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=20110629191518.GA23196@quack.suse.cz \
--to=jack@suse.cz \
--cc=curtw@google.com \
--cc=fengguang.wu@intel.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).