aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fs-writeback.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2010-05-17 06:51:03 -0400
committerJens Axboe <jens.axboe@oracle.com>2010-05-17 06:51:03 -0400
commit69b62d01ec44fe0d505d89917392347732135a4d (patch)
treeda40561f3d87ee1073e92ca925ed3ed36708a1d7 /fs/fs-writeback.c
parent2395e463fefd4aa8b784787e926e9b84e216d14f (diff)
writeback: disable periodic old data writeback for !dirty_writeback_centisecs
Prior to 2.6.32, setting /proc/sys/vm/dirty_writeback_centisecs disabled periodic dirty writeback from kupdate. This got broken and now causes excessive sys CPU usage if set to zero, as we'll keep beating on schedule(). Cc: stable@kernel.org Reported-by: Justin Maggard <jmaggard10@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r--fs/fs-writeback.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 4b37f7cea4dd..760dc8d0b4ff 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -852,6 +852,12 @@ static long wb_check_old_data_flush(struct bdi_writeback *wb)
852 unsigned long expired; 852 unsigned long expired;
853 long nr_pages; 853 long nr_pages;
854 854
855 /*
856 * When set to zero, disable periodic writeback
857 */
858 if (!dirty_writeback_interval)
859 return 0;
860
855 expired = wb->last_old_flush + 861 expired = wb->last_old_flush +
856 msecs_to_jiffies(dirty_writeback_interval * 10); 862 msecs_to_jiffies(dirty_writeback_interval * 10);
857 if (time_before(jiffies, expired)) 863 if (time_before(jiffies, expired))
@@ -947,8 +953,12 @@ int bdi_writeback_task(struct bdi_writeback *wb)
947 break; 953 break;
948 } 954 }
949 955
950 wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10); 956 if (dirty_writeback_interval) {
951 schedule_timeout_interruptible(wait_jiffies); 957 wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
958 schedule_timeout_interruptible(wait_jiffies);
959 } else
960 schedule();
961
952 try_to_freeze(); 962 try_to_freeze();
953 } 963 }
954 964