Skip to contentSkip to conversation

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

PATCH Applied Johannes Weiner 4 participants 4 messages Jul 28, 2020 – Jul 31, 2020

Subsystems (3)
lore
Share & tools
lore

Johannes Weiner

author maintainer
#0 lore raw

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

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")
---
 mm/memcontrol.c | 1 +
 1 file changed, 1 insertion(+)
mm/memcontrol.c +1 -0
index 13f559af1ab6..805a44bf948c 100644
@@ -6071,6 +6071,7 @@ static ssize_t memory_high_write(struct kernfs_open_file *of,
 			break;
 	}
 
+	memcg_wb_domain_size_changed(memcg);
 	return nbytes;
 }
 
Signature · 1 line
2.27.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Johannes Weiner

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.

Quoted 5 lines

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")
Reviewed-by on v1 1/1
#2 lore raw
In reply to Johannes Weiner
Quoted 9 lines · Johannes Weiner

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.

Quoted 5 lines

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")
Acked-by on v1 1/1
#3 lore raw
In reply to Johannes Weiner
Quoted 8 lines · Johannes Weiner

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.

Quoted 5 lines

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")
Quoted 18 lines
---
 mm/memcontrol.c | 1 +
 1 file changed, 1 insertion(+)
mm/memcontrol.c +1 -0
index 13f559af1ab6..805a44bf948c 100644
@@ -6071,6 +6071,7 @@ static ssize_t memory_high_write(struct kernfs_open_file *of,
 			break;
 	}
 
+	memcg_wb_domain_size_changed(memcg);
 	return nbytes;
 }
 
Signature · 1 line
2.27.0
Signature · 2 lines
Michal Hocko
SUSE Labs