Re: [PATCH v6 32/33] mm: memcontrol: eliminate the problem of dying memory cgroup for LRU folios

From: Joshua Hahn

Date: Mon Apr 06 2026 - 14:11:33 EST


On Thu, 5 Mar 2026 19:52:50 +0800 Qi Zheng <qi.zheng@xxxxxxxxx> wrote:

> From: Muchun Song <songmuchun@xxxxxxxxxxxxx>
>
> Now that everything is set up, switch folio->memcg_data pointers to
> objcgs, update the accessors, and execute reparenting on cgroup death.
>
> Finally, folio->memcg_data of LRU folios and kmem folios will always
> point to an object cgroup pointer. The folio->memcg_data of slab
> folios will point to an vector of object cgroups.
>
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
> Signed-off-by: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
> Acked-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
> ---

Hello Qi, thank you for this series!

> static void memcg_online_kmem(struct mem_cgroup *memcg)
> @@ -4949,16 +4985,20 @@ void mem_cgroup_calculate_protection(struct mem_cgroup *root,
> static int charge_memcg(struct folio *folio, struct mem_cgroup *memcg,
> gfp_t gfp)
> {
> - int ret;
> -
> - ret = try_charge(memcg, gfp, folio_nr_pages(folio));

While developing on top of mm-new I found that this was the last caller of
try_charge(). I was thinking that it might be a nice opportunity to just
remove the definition of try_charge() as well, maybe as a clean up patch
at the end of the series.

I see there are many acks on the entire series as well, and I don't think
it is worth doing a new version just for this. But if you are planning on
submitting a new version, I hope that you can consider this.

Thank you! Have a great day : -)
Joshua