[LTP] [PATCH] memcontrol03: Account for process size in cgroup allocation
Cyril Hrubis
chrubis@suse.cz
Fri May 9 11:21:27 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.
> This sentence in the commit message:
> "Account for process size as reported by cgroup memory stats before..."
> should be changed to:
> "Account for existing cgroup memory usage before..."
That sounds better. I suppose that we can get this merged with this
change.
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list