Re: [PATCH v3 3/5] mm: kmem: make memcg keep a reference to the original objcg

From: Vlastimil Babka
Date: Wed Oct 18 2023 - 07:58:51 EST


On 10/17/23 00:18, Roman Gushchin wrote:
> Keep a reference to the original objcg object for the entire life
> of a memcg structure.
>
> This allows to simplify the synchronization on the kernel memory
> allocation paths: pinning a (live) memcg will also pin the
> corresponding objcg.
>
> The memory overhead of this change is minimal because object cgroups
> usually outlive their corresponding memory cgroups even without this
> change, so it's only an additional pointer per memcg.
>
> Signed-off-by: Roman Gushchin (Cruise) <roman.gushchin@xxxxxxxxx>
> Tested-by: Naresh Kamboju <naresh.kamboju@xxxxxxxxxx>
> Acked-by: Shakeel Butt <shakeelb@xxxxxxxxxx>

Reviewed-by: Vlastimil Babka <vbabka@xxxxxxx>