lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aUQFiFIsvSez8AAP@cmpxchg.org>
Date: Thu, 18 Dec 2025 08:45:44 -0500
From: Johannes Weiner <hannes@...xchg.org>
To: Qi Zheng <qi.zheng@...ux.dev>
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 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.

And please use @child, @parent (or @memcg, @parent) throughout instead
of @src and @dst.

> +
> +	reparent_unlocks(src, dst);
>  
>  	percpu_ref_kill(&objcg->refcnt);

With that,

Acked-by: Johannes Weiner <hannes@...xchg.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ