[LTP] [PATCH] memcontrol03: Account for process size in cgroup allocation
Cyril Hrubis
chrubis@suse.cz
Fri May 9 12:01:47 CEST 2025
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.
That does sound strange. @Michal any idea what happens here?
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list