Re: [PATCH] memcg: drain obj stock on cpu hotplug teardown

From: Roman Gushchin
Date: Tue Mar 11 2025 - 12:27:00 EST


On Mon, Mar 10, 2025 at 04:09:34PM -0700, Shakeel Butt wrote:
> Currently on cpu hotplug teardown, only memcg stock is drained but we
> need to drain the obj stock as well otherwise we will miss the stats
> accumulated on the target cpu as well as the nr_bytes cached. The stats
> include MEMCG_KMEM, NR_SLAB_RECLAIMABLE_B & NR_SLAB_UNRECLAIMABLE_B. In
> addition we are leaking reference to struct obj_cgroup object.
>
> Fixes: bf4f059954dc ("mm: memcg/slab: obj_cgroup API")
> Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
> Cc: <stable@xxxxxxxxxxxxxxx>

Reviewed-by: Roman Gushchin <roman.gushchin@xxxxxxxxx>

Thanks!