summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2011-04-23 11:26:07 -0600
committerWu Fengguang <fengguang.wu@intel.com>2011-06-08 08:25:22 +0800
commite185dda89d69cde142b48059413a03561f41f78a (patch)
tree505fa875bdf7968892882a1f93993c9114d768b0 /fs
parente8dfc30582995ae12454cda517b17d6294175b07 (diff)
writeback: avoid extra sync work at enqueue time
This removes writeback_control.wb_start and does more straightforward sync livelock prevention by setting .older_than_this to prevent extra inodes from being enqueued in the first place. Acked-by: Jan Kara <jack@suse.cz> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/fs-writeback.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 565b1fd15be6..d0553f33fb50 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -544,15 +544,6 @@ static int writeback_sb_inodes(struct super_block *sb, struct bdi_writeback *wb,
continue;
}
- /*
- * Was this inode dirtied after sync_sb_inodes was called?
- * This keeps sync from extra jobs and livelock.
- */
- if (inode_dirtied_after(inode, wbc->wb_start)) {
- spin_unlock(&inode->i_lock);
- return 1;
- }
-
__iget(inode);
pages_skipped = wbc->pages_skipped;
@@ -585,9 +576,6 @@ static void __writeback_inodes_wb(struct bdi_writeback *wb,
{
int ret = 0;
- if (!wbc->wb_start)
- wbc->wb_start = jiffies; /* livelock avoidance */
-
while (!list_empty(&wb->b_io)) {
struct inode *inode = wb_inode(wb->b_io.prev);
struct super_block *sb = inode->i_sb;
@@ -686,7 +674,9 @@ static long wb_writeback(struct bdi_writeback *wb,
if (wbc.sync_mode == WB_SYNC_ALL || wbc.tagged_writepages)
write_chunk = LONG_MAX;
- wbc.wb_start = jiffies; /* livelock avoidance */
+ oldest_jif = jiffies;
+ wbc.older_than_this = &oldest_jif;
+
spin_lock(&wb->list_lock);
for (;;) {
/*