diff mbox series

mm: memcontrol: restore proper dirty throttling when memory.high changes

Message ID 20200728135210.379885-1-hannes@cmpxchg.org
State New
Headers show
Series mm: memcontrol: restore proper dirty throttling when memory.high changes | expand

Commit Message

Johannes Weiner July 28, 2020, 1:52 p.m. UTC
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 <hannes@cmpxchg.org>
---
 mm/memcontrol.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Chris Down July 28, 2020, 2:07 p.m. UTC | #1
Johannes Weiner writes:
>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 <hannes@cmpxchg.org>

Acked-by: Chris Down <chris@chrisdown.name>
Shakeel Butt July 28, 2020, 3:07 p.m. UTC | #2
On Tue, Jul 28, 2020 at 6:53 AM Johannes Weiner <hannes@cmpxchg.org> wrote:
>
> 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 <hannes@cmpxchg.org>

Reviewed-by: Shakeel Butt <shakeelb@google.com>
Michal Hocko July 31, 2020, 8:18 a.m. UTC | #3
On Tue 28-07-20 09:52:09, Johannes Weiner wrote:
> 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 <hannes@cmpxchg.org>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  mm/memcontrol.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 13f559af1ab6..805a44bf948c 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -6071,6 +6071,7 @@ static ssize_t memory_high_write(struct kernfs_open_file *of,
>  			break;
>  	}
>  
> +	memcg_wb_domain_size_changed(memcg);
>  	return nbytes;
>  }
>  
> -- 
> 2.27.0
diff mbox series

Patch

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 13f559af1ab6..805a44bf948c 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6071,6 +6071,7 @@  static ssize_t memory_high_write(struct kernfs_open_file *of,
 			break;
 	}
 
+	memcg_wb_domain_size_changed(memcg);
 	return nbytes;
 }