diff options
-rw-r--r-- | fs/fs-writeback.c | 8 | ||||
-rw-r--r-- | mm/backing-dev.c | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index e3ab1e4dc442..f79f641de4ff 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -1038,10 +1038,10 @@ void bdi_writeback_workfn(struct work_struct *work) | |||
1038 | trace_writeback_pages_written(pages_written); | 1038 | trace_writeback_pages_written(pages_written); |
1039 | } | 1039 | } |
1040 | 1040 | ||
1041 | if (!list_empty(&bdi->work_list) || | 1041 | if (!list_empty(&bdi->work_list)) |
1042 | (wb_has_dirty_io(wb) && dirty_writeback_interval)) | 1042 | mod_delayed_work(bdi_wq, &wb->dwork, 0); |
1043 | queue_delayed_work(bdi_wq, &wb->dwork, | 1043 | else if (wb_has_dirty_io(wb) && dirty_writeback_interval) |
1044 | msecs_to_jiffies(dirty_writeback_interval * 10)); | 1044 | bdi_wakeup_thread_delayed(bdi); |
1045 | 1045 | ||
1046 | current->flags &= ~PF_SWAPWRITE; | 1046 | current->flags &= ~PF_SWAPWRITE; |
1047 | } | 1047 | } |
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 502517492258..95e437435788 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
@@ -287,13 +287,16 @@ int bdi_has_dirty_io(struct backing_dev_info *bdi) | |||
287 | * Note, we wouldn't bother setting up the timer, but this function is on the | 287 | * Note, we wouldn't bother setting up the timer, but this function is on the |
288 | * fast-path (used by '__mark_inode_dirty()'), so we save few context switches | 288 | * fast-path (used by '__mark_inode_dirty()'), so we save few context switches |
289 | * by delaying the wake-up. | 289 | * by delaying the wake-up. |
290 | * | ||
291 | * We have to be careful not to postpone flush work if it is scheduled for | ||
292 | * earlier. Thus we use queue_delayed_work(). | ||
290 | */ | 293 | */ |
291 | void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi) | 294 | void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi) |
292 | { | 295 | { |
293 | unsigned long timeout; | 296 | unsigned long timeout; |
294 | 297 | ||
295 | timeout = msecs_to_jiffies(dirty_writeback_interval * 10); | 298 | timeout = msecs_to_jiffies(dirty_writeback_interval * 10); |
296 | mod_delayed_work(bdi_wq, &bdi->wb.dwork, timeout); | 299 | queue_delayed_work(bdi_wq, &bdi->wb.dwork, timeout); |
297 | } | 300 | } |
298 | 301 | ||
299 | /* | 302 | /* |