* [PATCH] mm: fix ratelimit_pages update error in dirty_ratio_handler()
@ 2025-04-15 8:35 alexjlzheng
0 siblings, 0 replies; only message in thread
From: alexjlzheng @ 2025-04-15 8:35 UTC (permalink / raw)
To: willy, akpm, andrea, fengguang.wu
Cc: linux-fsdevel, linux-mm, linux-kernel, mengensun, Jinliang Zheng, stable
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.
Fixes: 9d823e8f6b1b ("writeback: per task dirty rate limit")
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Cc: stable@vger.kernel.org
---
mm/page-writeback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
2.49.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-15 8:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-15 8:35 [PATCH] mm: fix ratelimit_pages update error in dirty_ratio_handler() alexjlzheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox