Message ID | 20250415090232.7544-1-alexjlzheng@tencent.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v2] mm: fix ratelimit_pages update error in dirty_ratio_handler() | expand |
On Tue, 15 Apr 2025 17:02:32 +0800 alexjlzheng@gmail.com wrote: > From: Jinliang Zheng <alexjlzheng@tencent.com> > > In the dirty_ratio_handler() function, vm_dirty_bytes must be set to > zero before calling writeback_set_ratelimit(), as global_dirty_limits() > always prioritizes the value of vm_dirty_bytes. Can you please tell us precisely where global_dirty_limits() prioritizes vm_dirty_bytes? I spent a while chasing code and didn't see how global_dirty_limits() gets to node_dirty_ok()(?). > That causes ratelimit_pages to still use the value calculated based on > vm_dirty_bytes, which is wrong now. > > Fixes: 9d823e8f6b1b ("writeback: per task dirty rate limit") > Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com> > Reviewed-by: MengEn Sun <mengensun@tencent.com> > Cc: stable@vger.kernel.org Please, as always, provide a description of the userspace-visible effects of this bug?
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index c81624bc3969..20e1d76f1eba 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -520,8 +520,8 @@ static int dirty_ratio_handler(const struct ctl_table *table, int write, void *b ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); if (ret == 0 && write && vm_dirty_ratio != old_ratio) { - writeback_set_ratelimit(); vm_dirty_bytes = 0; + writeback_set_ratelimit(); } return ret; }