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

Martin Doucha mdoucha@suse.cz
Fri May 9 11:40:26 CEST 2025


On 09. 05. 25 11:21, Cyril Hrubis wrote:
> Hi!
>>> Here we depend on the fact that process memory has been properly
>>> accounted for when it starts running its code. Are you sure that we can
>>> rely on this or does this just happen to work?
>>
>> Actually, my commit message is slightly misleading because the existing
>> process memory does not get migrated to the new cgroup. But the cgroup
>> itself may already have non-zero memory usage even when empty, likely
>> for internal kernel structures. Any new allocations of kernel structures
>> should also be finished when the process migration completes. So unless
>> the migration behavior changes in the near future, we can rely on this.
> 
> I suppose that the cgroup is charged for the memory it needs to track
> the resources, that makes sense. I wonder if we can read that once at
> the start of the test when we create the cgroups and use that value
> later on.

Unfortunately, we can't. I've tested this and memory.current can change 
a lot during the first process 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