From: Jens Axboe <jens.axboe@oracle.com>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Jan Kara <jack@suse.cz>, LKML <linux-kernel@vger.kernel.org>,
Theodore Tso <tytso@mit.edu>
Subject: Re: [PATCH] fs: Fix busyloop in wb_writeback()
Date: Mon, 21 Sep 2009 15:06:34 +0200 [thread overview]
Message-ID: <20090921130634.GX23126@kernel.dk> (raw)
In-Reply-To: <20090921130145.GA6266@localhost>
On Mon, Sep 21 2009, Wu Fengguang wrote:
> On Thu, Sep 17, 2009 at 02:41:06AM +0800, Jens Axboe wrote:
> > On Wed, Sep 16 2009, Jan Kara wrote:
> > > If all inodes are under writeback (e.g. in case when there's only one inode
> > > with dirty pages), wb_writeback() with WB_SYNC_NONE work basically degrades
> > > to busylooping until I_SYNC flags of the inode is cleared. Fix the problem by
> > > waiting on I_SYNC flags of an inode on b_more_io list in case we failed to
> > > write anything.
> >
> > Interesting, so this will happen if the dirtier and flush thread end up
> > "fighting" each other over the same inode. I'll throw this into the
> > testing mix.
> >
> > How did you notice?
>
> Jens, I found another busy loop. Not sure about the solution, but here
> is the quick fact.
>
> Tested git head is 1ef7d9aa32a8ee054c4d4fdcd2ea537c04d61b2f, which
> seems to be the last writeback patch in the linux-next tree. I cannot
> run the plain head of linux-next because it just refuses boot up.
>
> On top of which Jan Kara's I_SYNC waiting patch and the attached
> debugging patch is applied.
>
> Test commands are:
>
> # mount /mnt/test # ext4 fs
> # echo 1 > /proc/sys/fs/dirty_debug
>
> # cp /dev/zero /mnt/test/zero0
>
> After that the box is locked up, the system is busy doing these:
>
> [ 54.740295] requeue_io() +457: inode=79232
> [ 54.740300] mm/page-writeback.c +539 balance_dirty_pages(): comm=cp pid=3327 n=0
> [ 54.740303] global dirty=60345 writeback=10145 nfs=0 flags=_M towrite=1536 skipped=0
> [ 54.740317] requeue_io() +457: inode=79232
> [ 54.740322] mm/page-writeback.c +539 balance_dirty_pages(): comm=cp pid=3327 n=0
> [ 54.740325] global dirty=60345 writeback=10145 nfs=0 flags=_M towrite=1536 skipped=0
> [ 54.740339] requeue_io() +457: inode=79232
> [ 54.740344] mm/page-writeback.c +539 balance_dirty_pages(): comm=cp pid=3327 n=0
> [ 54.740347] global dirty=60345 writeback=10145 nfs=0 flags=_M towrite=1536 skipped=0
> ......
>
> Basically the traces show that balance_dirty_pages() is busy looping.
> It cannot write anything because the inode always be requeued by this line:
>
> if (inode->i_state & I_SYNC) {
> if (!wait) {
> requeue_io(inode);
> return 0;
> }
>
> This seem to happen when the partition is FULL.
OK, I'll have to look into these issues soonish. I'll be travelling next
week though, so I cannot do more about it right now. If you have time to
work on tested patches, then that would be MUCH appreciated it!
--
Jens Axboe
next prev parent reply other threads:[~2009-09-21 13:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-16 17:22 [PATCH] fs: Fix busyloop in wb_writeback() Jan Kara
2009-09-16 18:41 ` Jens Axboe
2009-09-17 9:09 ` Jan Kara
2009-09-21 13:01 ` Wu Fengguang
2009-09-21 13:06 ` Jens Axboe [this message]
2009-09-21 13:10 ` Wu Fengguang
2009-09-21 13:40 ` Jens Axboe
2009-09-21 13:19 ` Jan Kara
2009-09-21 13:28 ` Wu Fengguang
2009-09-19 1:53 ` Wu Fengguang
2009-09-20 2:35 ` Wu Fengguang
2009-09-20 17:43 ` Jan Kara
2009-09-21 1:08 ` Wu Fengguang
2009-09-21 13:45 ` Jan Kara
2009-09-21 14:11 ` Wu Fengguang
2009-09-21 14:19 ` Chris Mason
2009-09-21 14:31 ` Wu Fengguang
2009-09-21 14:45 ` Chris Mason
2009-09-22 9:14 ` Wu Fengguang
2009-09-23 7:56 ` 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=20090921130634.GX23126@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=fengguang.wu@intel.com \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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