2007-12-28 13:54:31

by Wu Fengguang

[permalink] [raw]
Subject: [PATCH 02/11] writeback: requeue_io_wait() on blocked kupdate

Convert to requeue_io_wait() for case:

kupdate cannot write all pages because of uncontrollable bad conditions.

Cc: Michael Rubin <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
---
fs/fs-writeback.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

--- linux-2.6.24-rc6-mm1.orig/fs/fs-writeback.c
+++ linux-2.6.24-rc6-mm1/fs/fs-writeback.c
@@ -292,11 +292,16 @@ __sync_single_inode(struct inode *inode,
* 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;
- requeue_io(inode);
+ 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

--