From: Fengguang Wu <wfg@mail.ustc.edu.cn>
To: Andrew Morton <akpm@osdl.org>
Cc: Peter Zijlstra <peterz@infradead.org>, Michael Rubin <mrubin@google.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 03/11] writeback: replace redirty_tail() on more-pages-to-sync
Date: Fri, 28 Dec 2007 21:41:22 +0800 [thread overview]
Message-ID: <398849894.92868@ustc.edu.cn> (raw)
Message-ID: <20071228135122.055004293@mail.ustc.edu.cn> (raw)
In-Reply-To: 20071228134119.112899193@mail.ustc.edu.cn
[-- Attachment #1: writeback-simplify-more-io.patch --]
[-- Type: text/plain, Size: 2419 bytes --]
Replace redirty_tail() with requeue_io()/requeue_io_wait() when
there are more pages to sync. There won't be starvation.
Cc: Michael Rubin <mrubin@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
---
fs/fs-writeback.c | 43 ++++++++-----------------------------------
1 file changed, 8 insertions(+), 35 deletions(-)
--- linux-2.6.24-rc6-mm1.orig/fs/fs-writeback.c
+++ linux-2.6.24-rc6-mm1/fs/fs-writeback.c
@@ -273,46 +273,19 @@ __sync_single_inode(struct inode *inode,
if (!(inode->i_state & I_FREEING)) {
if (!(inode->i_state & I_DIRTY) &&
mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
/*
* We didn't write back all the pages. nfs_writepages()
- * sometimes bales out without doing anything. Redirty
- * the inode; Move it from s_io onto s_more_io/s_dirty.
+ * sometimes bales out without doing anything.
*/
- /*
- * akpm: if the caller was the kupdate function we put
- * this inode at the head of s_dirty so it gets first
- * consideration. Otherwise, move it to the tail, for
- * the reasons described there. I'm not really sure
- * how much sense this makes. Presumably I had a good
- * reasons for doing it this way, and I'd rather not
- * muck with it at present.
- */
- if (wbc->for_kupdate) {
- /*
- * For the kupdate function we move the inode
- * to s_more_io so it will get more writeout as
- * soon as the queue becomes uncongested.
- */
- inode->i_state |= I_DIRTY_PAGES;
- if (wbc->nr_to_write > 0)
- /* somehow blocked: wait and retry */
- requeue_io_wait(inode);
- else
- /* slice used up: queue for next turn */
- requeue_io(inode);
- } else {
- /*
- * Otherwise fully redirty the inode so that
- * other inodes on this superblock will get some
- * writeout. Otherwise heavy writing to one
- * file would indefinitely suspend writeout of
- * all the other files.
- */
- inode->i_state |= I_DIRTY_PAGES;
- redirty_tail(inode);
- }
+ inode->i_state |= I_DIRTY_PAGES;
+ if (wbc->nr_to_write > 0)
+ /* somehow blocked: wait and retry */
+ requeue_io_wait(inode);
+ else
+ /* slice used up: queue for next turn */
+ requeue_io(inode);
} else if (inode->i_state & I_DIRTY) {
/*
* Someone redirtied the inode while were writing back
* the pages.
*/
--
next prev parent reply other threads:[~2007-12-28 13:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20071228134119.112899193@mail.ustc.edu.cn>
2007-12-28 13:41 ` [PATCH 00/11] writeback bug fixes and simplifications Fengguang Wu
[not found] ` <20071228135121.729972858@mail.ustc.edu.cn>
2007-12-28 13:41 ` [PATCH 01/11] writeback: introduce s_more_io_wait for inodes to be re-synced after a while Fengguang Wu
[not found] ` <20071228135121.907366463@mail.ustc.edu.cn>
2007-12-28 13:41 ` [PATCH 02/11] writeback: requeue_io_wait() on blocked kupdate Fengguang Wu
[not found] ` <20071228135122.055004293@mail.ustc.edu.cn>
2007-12-28 13:41 ` Fengguang Wu [this message]
[not found] ` <20071228135122.207057056@mail.ustc.edu.cn>
2007-12-28 13:41 ` [PATCH 04/11] writeback: requeue_io_wait() on locked inode Fengguang Wu
[not found] ` <20071228135122.352597180@mail.ustc.edu.cn>
2007-12-28 13:41 ` [PATCH 05/11] writeback: requeue_io_wait() on congested blockdev Fengguang Wu
[not found] ` <20071228135122.498901458@mail.ustc.edu.cn>
2007-12-28 13:41 ` [PATCH 06/11] writeback: requeue_io_wait() on locked buffers Fengguang Wu
[not found] ` <20071228135122.639594456@mail.ustc.edu.cn>
2007-12-28 13:41 ` [PATCH 07/11] writeback: requeue_io() on redirtied inode Fengguang Wu
[not found] ` <20071228135122.779152029@mail.ustc.edu.cn>
2007-12-28 13:41 ` [PATCH 08/11] writeback: introduce queue_dirty() Fengguang Wu
[not found] ` <20071228135122.931500020@mail.ustc.edu.cn>
2007-12-28 13:41 ` [PATCH 09/11] writeback: replace redirty_tail() on memory-backed bdi Fengguang Wu
[not found] ` <20071228135123.092384048@mail.ustc.edu.cn>
2007-12-28 13:41 ` [PATCH 10/11] writeback: remove redirty_tail() Fengguang Wu
[not found] ` <20071228135123.237186756@mail.ustc.edu.cn>
2007-12-28 13:41 ` [PATCH 11/11] writeback: __sync_single_inode() code cleanup 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=398849894.92868@ustc.edu.cn \
--to=wfg@mail.ustc.edu.cn \
--cc=akpm@osdl.org \
--cc=mrubin@google.com \
--cc=peterz@infradead.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