[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <81e91219-478f-4f23-8bde-b307130ddf67@linux.dev>
Date: Mon, 22 Dec 2025 11:56:32 +0800
From: Qi Zheng <qi.zheng@...ux.dev>
To: Johannes Weiner <hannes@...xchg.org>
Cc: hughd@...gle.com, mhocko@...e.com, roman.gushchin@...ux.dev,
shakeel.butt@...ux.dev, muchun.song@...ux.dev, david@...nel.org,
lorenzo.stoakes@...cle.com, ziy@...dia.com, harry.yoo@...cle.com,
imran.f.khan@...cle.com, kamalesh.babulal@...cle.com,
axelrasmussen@...gle.com, yuanchu@...gle.com, weixugc@...gle.com,
chenridong@...weicloud.com, mkoutny@...e.com, akpm@...ux-foundation.org,
hamzamahfooz@...ux.microsoft.com, apais@...ux.microsoft.com,
lance.yang@...ux.dev, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org, Qi Zheng <zhengqi.arch@...edance.com>
Subject: Re: [PATCH v2 26/28] mm: memcontrol: refactor memcg_reparent_objcgs()
On 12/18/25 9:45 PM, Johannes Weiner wrote:
> On Wed, Dec 17, 2025 at 03:27:50PM +0800, Qi Zheng wrote:
>> +static void memcg_reparent_objcgs(struct mem_cgroup *src)
>> +{
>> + struct obj_cgroup *objcg = rcu_dereference_protected(src->objcg, true);
>> + struct mem_cgroup *dst = parent_mem_cgroup(src);
>> +
>> + reparent_locks(src, dst);
>> +
>> + __memcg_reparent_objcgs(src, dst);
>
> Please have __memcg_reparent_objcgs() return the dead objcg for the
> percpu_ref_kill(), instead of doing the deref twice.
OK, will do.
>
> And please use @child, @parent (or @memcg, @parent) throughout instead
> of @src and @dst.
OK.
>
>> +
>> + reparent_unlocks(src, dst);
>>
>> percpu_ref_kill(&objcg->refcnt);
>
> With that,
>
> Acked-by: Johannes Weiner <hannes@...xchg.org>
Thanks!
Powered by blists - more mailing lists