[LTP] [RFC PATCH] getrusage03: account for percpu RSS counter batching

Cyril Hrubis chrubis@suse.cz
Wed Sep 2 14:25:30 CEST 2026


Hi!
> getrusage03 allows ru_maxrss to differ from the expected value by a
> fixed 20 MiB. That can be too small on large systems after Linux commit
> f1a7941243c1 ("mm: convert mm's rss stats into percpu_counter").
> 
> The fast RSS read may miss percpu counter batches, and the batch size
> scales with the number of online CPUs. The test child is single threaded,
> but it can migrate while faulting memory, so allow two batches worth of
> slack based on the online CPU count and page size. Keep the existing
> 20 MiB floor for smaller systems.
> 
> This is sent as RFC because it makes the test tolerate Linux's current
> percpu counter batching behavior instead of treating the smaller
> ru_maxrss value as a kernel failure.

Maybe we can pin the whole test to a single CPU instead. Otherwise the
max rss delta can easily get into hundreds of megabytes, which is more
than the test consumes.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list