aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/fs-writeback.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 002be0ff2ab3..05444eaa3f36 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -848,17 +848,18 @@ int bdi_writeback_thread(void *data)
848 break; 848 break;
849 } 849 }
850 850
851 if (dirty_writeback_interval) { 851 set_current_state(TASK_INTERRUPTIBLE);
852 wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10); 852 if (!list_empty(&bdi->work_list)) {
853 schedule_timeout_interruptible(wait_jiffies);
854 } else {
855 set_current_state(TASK_INTERRUPTIBLE);
856 if (list_empty_careful(&wb->bdi->work_list) &&
857 !kthread_should_stop())
858 schedule();
859 __set_current_state(TASK_RUNNING); 853 __set_current_state(TASK_RUNNING);
854 continue;
860 } 855 }
861 856
857 if (dirty_writeback_interval) {
858 wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
859 schedule_timeout(wait_jiffies);
860 } else
861 schedule();
862
862 try_to_freeze(); 863 try_to_freeze();
863 } 864 }
864 865