[LTP] [PATCH] memcontrol03: Account for process size in cgroup allocation

Martin Doucha mdoucha@suse.cz
Fri May 9 16:41:57 CEST 2025


On 09. 05. 25 16:11, Michal Koutný wrote:
> On Fri, May 09, 2025 at 12:01:47PM +0200, Cyril Hrubis <chrubis@suse.cz> wrote:
>>> Unfortunately, we can't. I've tested this and memory.current can change
>>> a lot during the first process migration.
>>
>> That does sound strange. @Michal any idea what happens here?
> 
> [Process migrates itself (echo 0 >$target_cg/cgroup.procs) or] it's
> otherwise active during the migration?
> 
> (Also, the apparent increase of memory.current may be amplified because
> of MEMCG_CHARGE_BATCH even with initially small allocation.)

The process migrates itself:
SAFE_CG_PRINTF(cg, "cgroup.procs", "%d", getpid());

We're dealing with an issue where the test has 2MB safety margin from 
triggering OOM but immediately after the process migrates itself into 
the cgroup on PPC64LE, memory.current will be ~4MB and the process will 
randomly trigger OOM anyway. So we're increasing the safety margin by 
whatever memory.current says immediately after the migration.

-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic


More information about the ltp mailing list