aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fs-writeback.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2011-10-19 05:44:41 -0400
committerWu Fengguang <fengguang.wu@intel.com>2011-12-18 01:20:18 -0500
commit1bc36b6426ae49139e9f56491db76b95921454d7 (patch)
tree66708091d7628c45cb81279dcdefd911b11aa3e1 /fs/fs-writeback.c
parentb3bba872ddb0320a7ecb54decae53c13ceb2ed4c (diff)
writeback: Include all dirty inodes in background writeback
Current livelock avoidance code makes background work to include only inodes that were dirtied before background writeback has started. However background writeback can be running for a long time and thus excluding newly dirtied inodes can eventually exclude significant portion of dirty inodes making background writeback inefficient. Since background writeback avoids livelocking the flusher thread by yielding to any other work, there is no real reason why background work should not include all dirty inodes so change the logic in wb_writeback(). Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r--fs/fs-writeback.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 517f211a3bd4..92d353e069dc 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -743,11 +743,17 @@ static long wb_writeback(struct bdi_writeback *wb,
743 if (work->for_background && !over_bground_thresh(wb->bdi)) 743 if (work->for_background && !over_bground_thresh(wb->bdi))
744 break; 744 break;
745 745
746 /*
747 * Kupdate and background works are special and we want to
748 * include all inodes that need writing. Livelock avoidance is
749 * handled by these works yielding to any other work so we are
750 * safe.
751 */
746 if (work->for_kupdate) { 752 if (work->for_kupdate) {
747 oldest_jif = jiffies - 753 oldest_jif = jiffies -
748 msecs_to_jiffies(dirty_expire_interval * 10); 754 msecs_to_jiffies(dirty_expire_interval * 10);
749 work->older_than_this = &oldest_jif; 755 } else if (work->for_background)
750 } 756 oldest_jif = jiffies;
751 757
752 trace_writeback_start(wb->bdi, work); 758 trace_writeback_start(wb->bdi, work);
753 if (list_empty(&wb->b_io)) 759 if (list_empty(&wb->b_io))