Re: [RFC PATCH v3 09/14] mm/memcontrol: Make memory.high tier-aware

Joshua Hahn <[email protected]>
Newsgroups org.kernel.vger.cgroups,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <[email protected]>
On Tue, 18 Aug 2026 09:21:15 +0800 Song Hu <[email protected]> wrote:

Hi Song, thank you for your reply.

> (pre-existing, not from this series - mentioning it here because
> it reworks memory.high behaviour)
> 
> The penalty computation in calculate_high_delay() can overflow:
> 
> 	penalty_jiffies = max_overage * max_overage * HZ;
> 
> max_overage is a fixed-point relative overage:
> calculate_overage() returns (usage - high) << 20 / high, so the
> square times HZ wraps once (usage - high) / high reaches
> 4096 / sqrt(HZ).  That is roughly 130x at HZ=1000 and 259x at
> HZ=250 - reachable when memory.high is tightened far below the
> current usage of a large working set.
> 
> Most wrapped values are still caught by the 2s clamp in
> mem_cgroup_handle_over_high(), but residues below the clamp pass
> through, and some of them produce far less throttling than
> intended - down to no sleep at all.
> 
> check_mul_overflow() with a clamp would saturate the penalty
> instead of wrapping it.  Could be folded in while memory.high is
> being reworked, or a standalone fix.

I think this could be a real concern, but I'm not sure that my series
is the right place to fold this change in. Namely because I don't
touch the penalty_jiffies / throttling part at all.

Maybe a standalone fix could be worth it? : -) I have no plans at the
moment so please feel free to take a crack at it if you think it's
a good idea!
Joshua
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.