|author||Yafang Shao <firstname.lastname@example.org>||2017-10-14 16:38:27 +0800|
|committer||Jens Axboe <email@example.com>||2017-10-14 09:14:35 -0600|
mm/page-writeback.c: make changes of dirty_writeback_centisecs take effect immediately
This patch is the followup of the prvious patch: [writeback: schedule periodic writeback with sysctl]. There's another issue to fix. For example, - When the tunable was set to one hour and is reset to one second, the new setting will not take effect for up to one hour. Kicking the flusher threads immediately fixes it. Cc: Jens Axboe <firstname.lastname@example.org> Cc: Jan Kara <email@example.com> Cc: Andrew Morton <firstname.lastname@example.org> Signed-off-by: Yafang Shao <email@example.com> Signed-off-by: Jens Axboe <firstname.lastname@example.org>
Diffstat (limited to 'mm/page-writeback.c')
1 files changed, 10 insertions, 1 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 622a18c114ca..c518c845f202 100644
@@ -1976,7 +1976,16 @@ int dirty_writeback_centisecs_handler(struct ctl_table *table, int write,
ret = proc_dointvec(table, write, buffer, length, ppos);
- if (!ret && !old_interval && dirty_writeback_interval)
+ * Writing 0 to dirty_writeback_interval will disable periodic writeback
+ * and a different non-zero value will wakeup the writeback threads.
+ * wb_wakeup_delayed() would be more appropriate, but it's a pain to
+ * iterate over all bdis and wbs.
+ * The reason we do this is to make the change take effect immediately.
+ if (!ret && write && dirty_writeback_interval &&
+ dirty_writeback_interval != old_interval)