From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) (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 0C8B83ACA61 for ; Wed, 21 Jan 2026 08:20:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768983622; cv=none; b=qnFRqMWOnm5p+dvGVTP/tVI/7gS4OPFQa1bMojMzb+BOSwCU7O0/Vt0ogIVWRTXxNkDQXuzNlouuQwgx+d/pqvRoGJ6Dl8HGuQ6HxnuYcL1JMnl/KTbcFYMhD3suw/6cIfZrKONqaUE3tFiXxAkew2E8IdgVAy7pAXhsDpRyAd4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768983622; c=relaxed/simple; bh=roY9SJu7tQziPZER9V+z21m8fFRs0wQ9DBTdX8sJLFY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aJjBVdCQ+99quwGhHRTnyqFhVHYbtzfQFBqJEjomN0QLkrnvKQ9SmNE4f6Sd2UUdLsoCoO6GOX9GkNCF54nuRJHSyrx0DwVuRihtX/JgA7VgSpmKdS5MCDgToP/hfe6F19xlDy6cRN0pMnNxjWLhWfthSPZfG+7PJbCHb3cR7YY= 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=DMquiX5p; arc=none smtp.client-ip=95.215.58.176 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="DMquiX5p" Date: Wed, 21 Jan 2026 00:20:10 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1768983618; 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=/C7RlKb6kG1iTpXvW7JQqVlIIZuudSPPRI9mtHGK9MM=; b=DMquiX5pLi5Jxf8xMEaJv17fESPSsBAXhtfXYVWupL0N0c37DPf2khFhe7aWvvq8A7U67E lcUMcLLxBIPuCJAtrwMkrIMlObW1IVdm/NdIDjjr4QGSLdgJ/37hkcB4EDyWZPnbDvZKH8 0z/DybNcVBxCL0pPtHcCSynGH3HW9G0= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Qi Zheng 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 Subject: Re: [PATCH v3 28/30 fix 1/2] mm: memcontrol: fix lruvec_stats->state_local reparenting Message-ID: References: <5a18658e-2076-4cbf-bc53-5b6e99c1035f@linux.dev> <37734a82-1544-4015-b4dc-30583441a7ba@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: <37734a82-1544-4015-b4dc-30583441a7ba@linux.dev> X-Migadu-Flow: FLOW_OUT 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 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.