From: Wu Fengguang <fengguang.wu@intel.com>
To: Jan Kara <jack@suse.cz>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
Dave Chinner <david@fromorbit.com>,
Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/7] writeback: avoid touching dirtied_when on blocked inodes
Date: Fri, 21 Oct 2011 18:40:49 +0800 [thread overview]
Message-ID: <20111021104049.GA3784@localhost> (raw)
In-Reply-To: <20111020232116.GB20542@quack.suse.cz>
Hi Jan,
> How about adding the attached patch to the series? With it applied we
> would have all busyloop prevention done in the same way.
Sure. It looks good.
> + pr_warn_ratelimited("mm: Possible busyloop in data writeback "
> + "(bdi %s nr_pages %ld sync_mode %d kupdate %d "
> + "background %d)\n",
> + wb->bdi->name, work->nr_pages, work->sync_mode,
> + work->for_kupdate, work->for_background);
I'll change the last two fields to the newly introduced writeback "reason":
pr_warn_ratelimited("mm: Possible busyloop in data writeback "
"(bdi %s nr_pages %ld sync_mode %d reason %s)\n",
wb->bdi->name, work->nr_pages, work->sync_mode,
wb_reason_name[work->reason]);
btw, with the I_SYNC case converted, it's actually no longer necessary
to keep a standalone b_more_io_wait. It should still be better to keep
the list and the above error check for catching possible errors and
the flexibility of adding policies like "don't retry possible blocked
inodes in N seconds as long as there are other inodes to work with".
The below diff only intends to show the _possibility_ to remove
b_more_io_wait:
--- linux-next.orig/fs/fs-writeback.c 2011-10-21 18:25:25.000000000 +0800
+++ linux-next/fs/fs-writeback.c 2011-10-21 18:27:41.000000000 +0800
@@ -235,20 +235,7 @@ static void requeue_io(struct inode *ino
list_move(&inode->i_wb_list, &wb->b_more_io);
}
-/*
- * The inode should be retried in an opportunistic way.
- *
- * The only difference between b_more_io and b_more_io_wait is:
- * wb_writeback() won't quit as long as b_more_io is not empty. When
- * wb_writeback() quit on empty b_more_io and non-empty b_more_io_wait,
- * the kupdate work will wakeup more frequently to retry the inodes in
- * b_more_io_wait.
- */
-static void requeue_io_wait(struct inode *inode, struct bdi_writeback *wb)
-{
- assert_spin_locked(&wb->list_lock);
- list_move(&inode->i_wb_list, &wb->b_more_io_wait);
-}
+#define requeue_io_wait(inode, wb) requeue_io(inode, wb)
static void inode_sync_complete(struct inode *inode)
{
@@ -798,21 +785,8 @@ static long wb_writeback(struct bdi_writ
* mean the overall work is done. So we keep looping as long
* as made some progress on cleaning pages or inodes.
*/
- if (progress)
- continue;
- /*
- * No more inodes for IO, bail
- */
- if (list_empty(&wb->b_more_io))
+ if (!progress)
break;
- /*
- * Nothing written but some inodes were moved to b_more_io.
- * This should not happen as we can easily busyloop.
- */
- pr_warn_ratelimited("mm: Possible busyloop in data writeback "
- "(bdi %s nr_pages %ld sync_mode %d reason %s)\n",
- wb->bdi->name, work->nr_pages, work->sync_mode,
- wb_reason_name[work->reason]);
}
spin_unlock(&wb->list_lock);
Thanks,
Fengguang
next prev parent reply other threads:[~2011-10-21 18:39 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-20 15:22 [PATCH 0/7] writeback: avoid touching dirtied_when on blocked inodes Wu Fengguang
2011-10-20 15:22 ` [PATCH 1/7] writeback: introduce queue b_more_io_wait Wu Fengguang
2011-10-20 23:23 ` Jan Kara
2011-10-20 15:22 ` [PATCH 2/7] writeback: avoid redirtying when ->write_inode failed to clear I_DIRTY Wu Fengguang
2011-10-20 23:24 ` Jan Kara
2011-10-20 15:22 ` [PATCH 3/7] writeback: update wb->last_active on written pages/inodes Wu Fengguang
2011-10-20 15:22 ` [PATCH 4/7] writeback: Retry kupdate work early if we need to retry some inode writeback Wu Fengguang
2011-10-20 15:22 ` [PATCH 5/7] writeback: requeue_io_wait() on pages_skipped inode Wu Fengguang
2011-10-20 23:25 ` Jan Kara
2011-10-20 15:22 ` [PATCH 6/7] writeback: requeue_io_wait() on blocked inode Wu Fengguang
2011-10-20 23:31 ` Jan Kara
2011-10-20 15:22 ` [PATCH 7/7] writeback: requeue_io_wait() when failed to grab superblock Wu Fengguang
2011-10-20 23:25 ` Jan Kara
2011-10-20 23:21 ` [PATCH 0/7] writeback: avoid touching dirtied_when on blocked inodes Jan Kara
2011-10-21 10:40 ` Wu Fengguang [this message]
2011-10-21 19:54 ` Jan Kara
2011-10-22 3:11 ` Wu Fengguang
2011-10-22 5:38 ` Wu Fengguang
2011-10-22 6:59 ` Wu Fengguang
2011-10-22 7:07 ` Wu Fengguang
2011-10-22 7:46 ` Wu Fengguang
2011-10-22 4:46 ` 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=20111021104049.GA3784@localhost \
--to=fengguang.wu@intel.com \
--cc=akpm@linux-foundation.org \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.