[LTP] [PATCH v2] memory: rewrite memcg_stress_test into C API

Michal Koutný mkoutny@suse.com
Fri Nov 7 11:37:04 CET 2025


Hi Andrea.

On Thu, Nov 06, 2025 at 09:16:06AM +0100, Andrea Cervesato <andrea.cervesato@suse.de> wrote:
> From: Andrea Cervesato <andrea.cervesato@suse.com>
> 
> This test will stress the cgroup implementation by allocating the whole
> free system memory inside multiple containers, one page at time.
> 
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
> The previous test was buggy and up to failures. This new implementation
> deletes shell script code and the C utility used by it, merging the code
> into C API libray.

I'm not that familiar with the old test, it talks about stressing
something but there aren't many assertions where one could check it. It
likely wanted to exhaust all memory uniformly from multiple cgroups,
however, I'm not sure whether it captures something realisting or
reality approaching.

Therefore, I like all the /^-/ lines of your patch :-)
And I also appreciate that the rewrite with standard routines results
in overall shorter code.

But you changed this exhaustion attempt by serializing the processes (it
would only use mem_per_proc /= cgroups_num at likely peak, not all of
the memory because of serialization AFAICS).
That intention could be explained better in the commit message.

(When I think about it, some realistic scenarios would be:
a) starting lots of containers in parallel (and observing latencies)
b) running short-lived jobs repeatedly (and checking that it can run
   indefinitely/sufficiently long w/out accumulation of any residuals)
That'd surely deserve a separate commit from the mere rewrite.
At it becomes more of a performance test rather than binary/discrete
verification of behavior.)

Thanks and HTH,
Michal


More information about the ltp mailing list