public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wu Fengguang <fengguang.wu@intel.com>
To: Jan Kara <jack@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Dave Chinner <david@fromorbit.com>,
	Christoph Hellwig <hch@lst.de>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 1/3] writeback: introduce wbc.tagged_sync for the WB_SYNC_NONE sync stage
Date: Thu, 5 May 2011 22:06:09 +0800	[thread overview]
Message-ID: <20110505140609.GB9409@localhost> (raw)
In-Reply-To: <20110505135508.GE5323@quack.suse.cz>

On Thu, May 05, 2011 at 09:55:08PM +0800, Jan Kara wrote:
> On Thu 05-05-11 20:14:02, Wu Fengguang wrote:
> > On Thu, May 05, 2011 at 05:00:59AM +0800, Jan Kara wrote:
> > > On Mon 02-05-11 11:17:51, Wu Fengguang wrote:
> > > > sync(2) is performed in two stages: the WB_SYNC_NONE sync and the
> > > > WB_SYNC_ALL sync. Tag the first stage with wbc.tagged_sync and do
> > > > livelock prevention for it, too.
> > > > 
> > > > Note that writeback_inodes_sb() is called by not only sync(), they are
> > > > treated the same because the other callers need also need livelock
> > > > prevention.
> > >   I was thinking about this and could not find any - which other callers
> > > of writeback_inodes_sb() need the livelock prevention?
> > 
> > For example, the writeback_inodes_sb_if_idle() call from ext4.
> > In general anyone that pass get_nr_dirty_pages() as work->nr_pages
> > may be highly over-estimating the work set.
>   OK, I see what you mean. I agree using tagging in these cases probably
> makes sense.
> 
> > It won't be directly livelocked since ext4 won't wait for completion,
> > however there is possibility the works queued behind are delayed and
> > livelocked.
>   Actually it will, writeback_inodes_sb() waits for completion (because of
> s_umount locking). ext4 should use writeback_inodes_sb_if_idle_nr() (with
> some relatively small number) anyway to avoid the pauses.

Ah yes!

> > Ideally simple ->nr_pages works should be given lower priority and
> > even may be merged with each other, and that would be future work.
>   Merging works wanting to do the same thing would be nice. I though about
> it some time ago for a while but getting all the combinations right and
> making the merging code resonably simple was hard so I postponed it for
> later because it was not urgent.

Agreed.

Thanks,
Fengguang

  reply	other threads:[~2011-05-05 14:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-02  3:17 [PATCH 0/3] sync livelock fixes v2 Wu Fengguang
2011-05-02  3:17 ` [PATCH 1/3] writeback: introduce wbc.tagged_sync for the WB_SYNC_NONE sync stage Wu Fengguang
2011-05-04 21:00   ` Jan Kara
2011-05-05 12:14     ` Wu Fengguang
2011-05-05 13:55       ` Jan Kara
2011-05-05 14:06         ` Wu Fengguang [this message]
2011-05-02  3:17 ` [PATCH 2/3] writeback: update dirtied_when for synced inode to prevent livelock Wu Fengguang
2011-05-04 21:10   ` Jan Kara
2011-05-05 12:18     ` Wu Fengguang
2011-05-02  3:17 ` [PATCH 3/3] writeback: avoid extra sync work at enqueue time Wu Fengguang
2011-05-04 21:24   ` Jan Kara
2011-05-05 12:27     ` Wu Fengguang
2011-05-05 12:41       ` Christoph Hellwig
2011-05-05 12:42         ` Christoph Hellwig
2011-05-05 12:48           ` Wu Fengguang
2011-05-05 14:01       ` Jan Kara
2011-05-05 14:10         ` Wu Fengguang
2011-05-05 14:13           ` Wu Fengguang
2011-05-05 14:34           ` Jan Kara

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=20110505140609.GB9409@localhost \
    --to=fengguang.wu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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