From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 AD647357A59 for ; Wed, 21 Jan 2026 11:26:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768994785; cv=none; b=efe35zq0Thh4QyRYPgT9BIYg6Y6lWlzHVOCvQwFBuFgxA8zJFc0Vlz8GLD5idgh2tDXos9PtmB/jB6sUEnxUahIVfRXl+go+D6dsq9Z/0Gk44v6UI/NexGY8UU+6nkiLRoXBvkIo42TW9JcF/IkG2deEJHUYe/MDfSQtQSPJFXw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768994785; c=relaxed/simple; bh=XJuFQG6tROVPxmopmKhhnYJFcbZUPiSyMXwpEqQ5REA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QnDPBNji1crxkxD+tBruZu3+odgGNmZXjPSBkcs3DXdDGyUvqM7FxCN5VWoFNs0Bd4jT3C1Q9GUSNi/Q4ZylCo6vilzptIl8XP10xzhMFprN+ImPSUsRvLBO9jDtcv11t8GKRBDR2tMmk3Pvq3UPiKV20uspCzB9GTnGjozLVYY= 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=bTZV01Al; arc=none smtp.client-ip=95.215.58.186 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="bTZV01Al" Message-ID: <7c49e382-9f67-4a49-a884-47c96ab348d5@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1768994771; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EI3PnO2ne3zU35Poebf9UA7r2AUkoJbbfNXfGukOLUk=; b=bTZV01Ali7NQ0Pn3QESP2LOgMVmYpkdVmP4rBR66PxR0itj/VUlFqvpJ/itCWXVTp/Yjly hYcwvqrg6rdDvmyZPbRY5TWkftQgGasc9tH1Qb4lQUX49dDOldHGUpXA0Me9bIi2XY0TRB lcUlt1qpotSi4uKtUn0n4jB/d1Kw/5o= Date: Wed, 21 Jan 2026 19:25:39 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v3 28/30 fix 1/2] mm: memcontrol: fix lruvec_stats->state_local reparenting To: Shakeel Butt Cc: Muchun Song , hannes@cmpxchg.org, hughd@google.com, mhocko@suse.com, roman.gushchin@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, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Qi Zheng References: <5a18658e-2076-4cbf-bc53-5b6e99c1035f@linux.dev> <37734a82-1544-4015-b4dc-30583441a7ba@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Qi Zheng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 1/21/26 4:20 PM, Shakeel Butt wrote: > On Wed, Jan 21, 2026 at 11:43:50AM +0800, Qi Zheng wrote: >> >> >> On 1/21/26 2:47 AM, Shakeel Butt wrote: >>> On Tue, Jan 20, 2026 at 03:19:00PM +0800, Muchun Song wrote: >>>> >>>> >>>>>> No reparenting local stats for v2. >>>>> >>>>> It seems that lruvec_stats->state_local (non-hierarchical) needs to be >>>>> relocated in both v1 and v2. >>>> >>>> Here we might need to elaborate a bit. Specifically, in the function >>>> `count_shadow_nodes`, the use of `lruvec_page_state_local` to obtain >>>> LRU and SLAB pages seems to also require these logics to work correctly. >>>> For SLAB, it appears that the statistics here have already been >>>> problematic for a while since SLAB pages have been reparented, right? >>>> >>> >>> Thanks a lot, now it is clear and yes it seems like SLAB is problematic >>> but now I am wondering if it is really worth fixing. For LRU pages, how >>> about using lruvec_lru_size() defined in vmscan.c. That would at least >>> keep count_shadow_nodes() working irrespective of LRU reparenting. >> >> Do you mean calling lruvec_lru_size() in count_shadow_nodes()? > > Yes but I am mainly brainstorming. We can keep the reparenting local OK, I will take a closer look. > stats for both v1 and v2 for now as it is not a performance critical > path. I am more worried about the stats update path where upward > traversal of memcg for CSS_DYING can be costly and I don't want that in > v2. > >> But >> numa_stat interface also reads lruvec_stats->state and make it visible >> to the user. >> > > Not sure how this is relevant. My mistake, please ignore it. Thanks!