From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (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 E740C3D9029 for ; Wed, 25 Feb 2026 17:06:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772039209; cv=none; b=uRvMlNPWdyMYVyQhuhepPTPi1Rde2WCsekRoNh2incyaN2bRsw6oHuaNlOcxV7QdVZCAY/EnkNKvbIQl6AgT2dJkRIwVHgwndMtQzmNDyTswBTYTloH1yCDJUlUabnbXAcCT4OfAotfk7CPODJxOqXmxgZl6vVdWLpb2dndZdhI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772039209; c=relaxed/simple; bh=pMK7KAEhwlOhE4+pvZvYFwy+6PAABVUiFILsUkr2fp0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qD35VyfG4RpnuC5YS/xIUawuWmYVl3qYcE8PICKsRD9egFmJtXdIMTGbZ6aTaqAQ6+EeCwIQl25DUzZhAhP7ybTjldHO/c7EhHoNb0tgsR4V3qkFxvUpQcNBii9KP48r+nmdDDvwDbzAos04ZibYo8zv6HkWYOYeTas0oxUjVpw= 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=X035a8hT; arc=none smtp.client-ip=91.218.175.181 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="X035a8hT" Date: Wed, 25 Feb 2026 09:06:38 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1772039203; 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=zMK2L/UhVRAe7lEsp8URB6RkTXODu73U0cxlBFOHU6M=; b=X035a8hTxsKugHSn2WtvAHXbu/0JLbIYatHwUUcXmjkR62WusmyvkEmLYsEPHcoQSddz1x RiSQ+tGr/krV1c7bzXMRoSCmijUQ7S3OYAh9Pc4PrSwkRd6l18bg7dri1JltcPIv5LXRTd gMie22jGGtJFjgKcLpBAYBlF5kYBWTA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: "David Hildenbrand (Arm)" Cc: Matthew Wilcox , Axel Rasmussen , Andrew Morton , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, muchun.song@linux.dev Subject: Re: [PATCH] Revert "ptdesc: remove references to folios from __pagetable_ctor() and pagetable_dtor()" Message-ID: References: <20260225002434.2953895-1-axelrasmussen@google.com> <6b5e14a9-751d-4a0d-9d53-b45a0ee5a4ed@kernel.org> Precedence: bulk X-Mailing-List: stable@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: <6b5e14a9-751d-4a0d-9d53-b45a0ee5a4ed@kernel.org> X-Migadu-Flow: FLOW_OUT +memcg maintainers On Wed, Feb 25, 2026 at 05:08:28PM +0100, David Hildenbrand (Arm) wrote: > On 2/25/26 17:03, Matthew Wilcox wrote: > > On Tue, Feb 24, 2026 at 04:24:34PM -0800, Axel Rasmussen wrote: > >> This change swapped out mod_node_page_state for lruvec_stat_add_folio. > >> But, these two APIs are not interchangeable: the lruvec version also > >> increments memcg stats, in addition to "global" pgdat stats. > >> > >> So after this change, the "pagetables" memcg stat in memory.stat always > >> yields "0", which is a userspace visible regression. > >> > >> I tried to look for a refactor where we add a variant of > >> lruvec_stat_mod_folio which takes a pgdat and a memcg instead of a > >> folio, to try to adhere to the spirit of the original patch. But at the > >> end of the day this just means we have to call > >> folio_memcg(ptdesc_folio(ptdesc)) anyway, which doesn't really > >> accomplish much. > > > > Thank you! I hadn't been able to get a straight answer on this before. > > > > You're right that there's no good function to call, but that just means > > we need to make one. The principle here is that (eventually) different > > memdescs don't need to know about each other. Obviously we're not there > > yet, but we can start disentangling them by not casting ptdescs back to > > folios (even though they're created that way). > > > > Here's three patches smooshed together; I have them separately and I'll > > post them soon. > > Should we just apply + backport the revert for now and re-do it based on > the revert? Yes please.