lkml.org 
[lkml]   [2017]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm/page-writeback.c: fix bug caused by disable periodic writeback
Date
After disable periodic writeback by writing 0 to
dirty_writeback_centisecs, the handler wb_workfn() will not be
entered again until the dirty background limit reaches or
sync syscall is executed or no enough free memory available or
vmscan is triggered.
So the periodic writeback can't be enabled by writing a non-zero
value to dirty_writeback_centisecs
As it can be disabled by sysctl, it should be able to enable by
sysctl as well.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
mm/page-writeback.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 0b9c5cb..e202f37 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -1972,7 +1972,13 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb)
int dirty_writeback_centisecs_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *length, loff_t *ppos)
{
- proc_dointvec(table, write, buffer, length, ppos);
+ unsigned int old_interval = dirty_writeback_interval;
+ int ret;
+
+ ret = proc_dointvec(table, write, buffer, length, ppos);
+ if (!ret && !old_interval && dirty_writeback_interval)
+ wakeup_flusher_threads(0, WB_REASON_PERIODIC);
+
return 0;
}

--
1.8.3.1
\
 
 \ /
  Last update: 2017-10-06 17:12    [W:0.068 / U:0.020 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site