From c6529f4413aeecc623cdfcbcc8abbe8388c2ccb7 Mon Sep 17 00:00:00 2001 From: Johannes Weiner Date: Thu, 6 Aug 2020 23:22:12 -0700 Subject: [PATCH 2430/2944] mm: memcontrol: restore proper dirty throttling when memory.high changes to #31164083 commit 19ce33acbbd03c371f2d4b533879c4755686f95f upstream Commit 8c8c383c04f6 ("mm: memcontrol: try harder to set a new memory.high") inadvertently removed a callback to recalculate the writeback cache size in light of a newly configured memory.high limit. Without letting the writeback cache know about a potentially heavily reduced limit, it may permit too many dirty pages, which can cause unnecessary reclaim latencies or even avoidable OOM situations. This was spotted while reading the code, it hasn't knowingly caused any problems in practice so far. Fixes: 8c8c383c04f6 ("mm: memcontrol: try harder to set a new memory.high") Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Reviewed-by: Shakeel Butt Acked-by: Chris Down Acked-by: Michal Hocko Cc: Roman Gushchin Link: http://lkml.kernel.org/r/20200728135210.379885-1-hannes@cmpxchg.org Signed-off-by: Linus Torvalds Signed-off-by: zhongjiang-ali Reviewed-by: Xunlei Pang --- mm/memcontrol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 83667d9..e08b7ec 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5701,6 +5701,8 @@ static ssize_t memory_high_write(struct kernfs_open_file *of, if (!is_wmark_ok(memcg, true)) queue_work(memcg_wmark_wq, &memcg->wmark_work); + memcg_wb_domain_size_changed(memcg); + return nbytes; } -- 1.8.3.1