Re: [RFC PATCH] mm: use precise current RSS for high-water accounting

From: Mathieu Desnoyers

Date: Thu Jul 23 2026 - 12:35:26 EST


On 2026-07-23 12:21, Nirmoy Das wrote:
Hi Mathieu,

On 2026-07-23 09:47, Mathieu Desnoyers wrote:
Did you compare this with my hierarchical percpu counters series ?

https://lore.kernel.org/lkml/20260707131544.75906-1-mathieu.desnoyers@xxxxxxxxxxxx/

I've sent it to Andrew two weeks ago but have not heard back from him
though. My series attack the same issue you are trying to solve without
increasing overhead when reading those counters.

I tested the v20 series on a dual-socket system with 352 CPUs and
64 KiB pages.

On the v7.2-rc4 test kernel without the series, getrusage03 failed
10/10:

TFAIL: child.children = 270336, expected 307200

With v20, it also failed 10/10:

TFAIL: initial.children = 0, expected 102400
TFAIL: child.children = 262144, expected 307200

In v20, get_mm_hiwater_rss() still calls get_mm_rss(), which uses an
approximate counter read. The series did not help this test.

Correct, my hierarchical counters keep a approximation there, but is
improves the accuracy of the approximation (worse case inaccuracy
limited by the topology).

What is this test validating ? Does it actually matter for a real-life
use-case, or is it just the test being too strict ?

What is the overhead impact of your change from approximated counter
read to a precise sum on this /proc ABI ?

Thanks,

Mathieu


Let me know if you want to me to try out something else.

Thanks,
Nirmoy


--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com