aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fs-writeback.c
diff options
context:
space:
mode:
authorWanpeng Li <liwanp@linux.vnet.ibm.com>2013-07-08 19:00:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 13:33:22 -0400
commit25d130ba22362757a90135fd8a0f75cc7fc71e79 (patch)
tree6d88bac53aaeba9c957a92a6df0e894c185f421c /fs/fs-writeback.c
parent6ce1bc86ae8b8f74095f2694732ccbab2f3849e5 (diff)
mm/writeback: don't check force_wait to handle bdi->work_list
After commit 839a8e8660b6 ("writeback: replace custom worker pool implementation with unbound workqueue"), bdi_writeback_workfn runs off bdi_writeback->dwork, on each execution, it processes bdi->work_list and reschedules if there are more things to do instead of flush any work that race with us existing. It is unecessary to check force_wait in wb_do_writeback since it is always 0 after the mentioned commit. This patch remove the force_wait in wb_do_writeback. Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Reviewed-by: Tejun Heo <tj@kernel.org> Reviewed-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r--fs/fs-writeback.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index aca8835c8c17..68851ff2fd41 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -963,7 +963,7 @@ static long wb_check_old_data_flush(struct bdi_writeback *wb)
963/* 963/*
964 * Retrieve work items and do the writeback they describe 964 * Retrieve work items and do the writeback they describe
965 */ 965 */
966static long wb_do_writeback(struct bdi_writeback *wb, int force_wait) 966static long wb_do_writeback(struct bdi_writeback *wb)
967{ 967{
968 struct backing_dev_info *bdi = wb->bdi; 968 struct backing_dev_info *bdi = wb->bdi;
969 struct wb_writeback_work *work; 969 struct wb_writeback_work *work;
@@ -971,12 +971,6 @@ static long wb_do_writeback(struct bdi_writeback *wb, int force_wait)
971 971
972 set_bit(BDI_writeback_running, &wb->bdi->state); 972 set_bit(BDI_writeback_running, &wb->bdi->state);
973 while ((work = get_next_work_item(bdi)) != NULL) { 973 while ((work = get_next_work_item(bdi)) != NULL) {
974 /*
975 * Override sync mode, in case we must wait for completion
976 * because this thread is exiting now.
977 */
978 if (force_wait)
979 work->sync_mode = WB_SYNC_ALL;
980 974
981 trace_writeback_exec(bdi, work); 975 trace_writeback_exec(bdi, work);
982 976
@@ -1025,7 +1019,7 @@ void bdi_writeback_workfn(struct work_struct *work)
1025 * rescuer as work_list needs to be drained. 1019 * rescuer as work_list needs to be drained.
1026 */ 1020 */
1027 do { 1021 do {
1028 pages_written = wb_do_writeback(wb, 0); 1022 pages_written = wb_do_writeback(wb);
1029 trace_writeback_pages_written(pages_written); 1023 trace_writeback_pages_written(pages_written);
1030 } while (!list_empty(&bdi->work_list)); 1024 } while (!list_empty(&bdi->work_list));
1031 } else { 1025 } else {