From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5790A374175 for ; Thu, 26 Feb 2026 02:28:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772072895; cv=none; b=N3FXFzA3xaDBLWM/qwNhXjZTY5vdqm/+S3lD+00S0nkoXQ1C4BIKdtmh4uUummQQCJ/pt47aF5mRsSczwAX3JpWFzj/umLYfHSVJJW9nnbVbuT+cE3x59gGA/CngmEeG57q80d4yU/Q1Bdo9Wa9yaCPTD1Dj1YrG2Z1KmG1Dr7c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772072895; c=relaxed/simple; bh=m3Y5OU4vPC5Kug79bnRfmWT3RINZid7mrn+RWwWruF4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PlmjRAYkus6J5kUeNZnXswIh2JMZxclP7LySKFQJ82i0290E/SBSuBRvKtoZCYqUJGVp+ZryKcxAip8aasSUZJT4nzsycPsuyWoAWg1JyOn+DYNprh0g+Wt2MYnVy3D/2QyAOnkzhUf9P3x7jCaUt6zchEKm+84VfipUR+oWu4k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=inLRTyPS; arc=none smtp.client-ip=91.218.175.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="inLRTyPS" Date: Wed, 25 Feb 2026 18:27:59 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1772072890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=J8G7n0G5IvJbjAWS80AASD+GlHfDZ2XYW2oW2fVo6QM=; b=inLRTyPSomd7cx4tU1l+xytkHbPVoB+tKgvlzV/f7mXEW2S2TI31JThNxm3yX9SBJdI5p1 i0VoBYNMyPj1gMmS3Ptyr4w2cftRfMimJ/kcnc7uxjbuoeeEjCNe2dKfi5gncND2OYLgLN KjtZfn55mBY7Dw+8pMmY+l0Ybo4QO+Q= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Qi Zheng Cc: hannes@cmpxchg.org, hughd@google.com, mhocko@suse.com, roman.gushchin@linux.dev, muchun.song@linux.dev, david@kernel.org, lorenzo.stoakes@oracle.com, ziy@nvidia.com, harry.yoo@oracle.com, yosry.ahmed@linux.dev, imran.f.khan@oracle.com, kamalesh.babulal@oracle.com, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, chenridong@huaweicloud.com, mkoutny@suse.com, akpm@linux-foundation.org, hamzamahfooz@linux.microsoft.com, apais@linux.microsoft.com, lance.yang@linux.dev, bhe@redhat.com, usamaarif642@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Qi Zheng Subject: Re: [PATCH v5 update 30/32] mm: memcontrol: convert objcg to be per-memcg per-node type Message-ID: References: <0f915487ffc653cf6ea19335c21c01aa06004641.1772005110.git.zhengqi.arch@bytedance.com> <20260225094456.74145-1-qi.zheng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260225094456.74145-1-qi.zheng@linux.dev> X-Migadu-Flow: FLOW_OUT On Wed, Feb 25, 2026 at 05:44:56PM +0800, Qi Zheng wrote: > From: Qi Zheng > > Convert objcg to be per-memcg per-node type, so that when reparent LRU > folios later, we can hold the lru lock at the node level, thus avoiding > holding too many lru locks at once. > > Signed-off-by: Qi Zheng > --- > changlog: > - fix a missing root_obj_cgroup conversion and completely delete > root_obj_cgroup. > > include/linux/memcontrol.h | 23 +++++------ > include/linux/sched.h | 2 +- > mm/memcontrol.c | 79 +++++++++++++++++++++++--------------- > 3 files changed, 62 insertions(+), 42 deletions(-) > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > index 45d911dd903e7..6e11552a90618 100644 > --- a/include/linux/memcontrol.h > +++ b/include/linux/memcontrol.h > @@ -116,6 +116,16 @@ struct mem_cgroup_per_node { > unsigned long lru_zone_size[MAX_NR_ZONES][NR_LRU_LISTS]; > struct mem_cgroup_reclaim_iter iter; > > + /* > + * objcg is wiped out as a part of the objcg repaprenting process. > + * orig_objcg preserves a pointer (and a reference) to the original > + * objcg until the end of live of memcg. > + */ > + struct obj_cgroup __rcu *objcg; > + struct obj_cgroup *orig_objcg; The layout of struct mem_cgroup_per_node is very performance sensitive. Please couple of performance benchmarks after rearranging the fields particularly the above two pointers together at the start of the struct. Otherwise: Acked-by: Shakeel Butt