Re: [PATCH v6 32/33] mm: memcontrol: eliminate the problem of dying memory cgroup for LRU folios
From: Qi Zheng
Date: Mon Apr 06 2026 - 22:16:14 EST
On 4/7/26 2:11 AM, Joshua Hahn wrote:
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
Yeah, we're already aware of this.
remove the definition of try_charge() as well, maybe as a clean up patch
at the end of the series.
Will send a separate cleanup patch later.
Thanks,
Qi