From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E09F038F955 for ; Wed, 25 Feb 2026 19:31:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772047893; cv=none; b=rgwsRi4ilCm4Zy47Mio7APGyJYY2P5xUTcJ2rCdOLy+/DAbw2BZTKZJTt8yzwL0aKytYH6b/wLGTw4o2CdnWYm9Kcexa0dNn3GR2lKpQM7mEBTXP9+DXLHYan6Y7XzID6ERJsHE5bkJ3mdQCkcK8aKgsDBQOjRTW842aFwsWiog= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772047893; c=relaxed/simple; bh=nBqF4w+CUs5G0Dk674hPgFrbQ9Ruua2n7FSfL7WEBlo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ptKDc/GL+JQl/YNNxt0f0AIm5jYsDsw3P+MZpCvD7HMo7yBujsNWBzjrxB9298TcnC2o36BtevZVbynybUmx8qR4BTIABaQIzCWImBMuELNmz4GwP9giU6Uvs6wCqAOroG4TYPgMYJWL6QVU6xoMuArVVINhvnpCDSifuQ9DwbY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b=gvMKoedl; arc=none smtp.client-ip=209.85.219.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b="gvMKoedl" Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-896f5af3d8aso1153346d6.1 for ; Wed, 25 Feb 2026 11:31:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg.org; s=google; t=1772047890; x=1772652690; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=q3Jxm9A3azjabtMJunPGxErvPjmUnEkcbOHkg5GFLOM=; b=gvMKoedldtlpnr+OKjNj67GSHzGtIsdMyAHeQDxnO8ge5VpROoJjslHgL1NuYC/Ejp genntVRbM3YYlyo9RVIuJstNp88lZLJlrl0WAcBrFpceDv4vy3JIZbFaDbanM0ljknTK j81bCI3wrTb2zxFplksD3kUyKYKDA0Kk4qALwf8sgktQWuv4IcSNASJ7KGcGmiG2RJMX MOlwotvv2nSINwl8G3nU0pIk3AkYCPl8IJPdMDaJDjf6/VBxALv5C2HcH9yobt1Ed0r6 fVSOOAggzkD2RdM9YPtSBc+agX77nzQBgX5nSVHFptN2ezjqODuScNnPoHNj5h/+61af NycQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772047890; x=1772652690; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q3Jxm9A3azjabtMJunPGxErvPjmUnEkcbOHkg5GFLOM=; b=FTz8ZdGMSE6hlB5UEFX3pQ3MPWOeme5mCeFrAVvRGqIgJs/aOjV9Frg0dsREt2th+G 1+tq2opoGPR/S/akY2kzvLOjnI8hSrhNeyYrrDrFymtky2TO+MRtywdOIiQv0TT36hfM vZ4iLq/LENlHuXYd/vM8FQho8gZv4UIrCJibuTv02+aM1EAMeteEGdiuFqIx+NP1doa4 DfeP3konxzjvkmtSeOPwkBi7XHhaX96yqJODbzvM11J0Q9m7hjcPntljbCvGf2e+LpU1 tSb7B037By0/xkm86c2xYlEr1gz+Wwkk0yQeq3Sx4NefMhxFerJLW/7Id1YC7gxWecld xNcw== X-Forwarded-Encrypted: i=1; AJvYcCUfzODBAEjnJZU9gmV2xfUwT/Fq8IK3DfOFcxaQp3wz4r2ggiJAb6+zOi0CYW74pAXAFlJycDqWgkGggQ4=@vger.kernel.org X-Gm-Message-State: AOJu0YxJhjM71JdqXQuBHAWgBEPTasYIQv0Jp3+IXs/NOkeXcX8UEvB4 maKcCMpwMsBf+BnOo7yUVybYhA56EhOGncLvkckt4Vxvw23fEbw7cVbImMJAIhTGJOA= X-Gm-Gg: ATEYQzyiyZ8SOhAor8KX/jLNzAnt6ZTg7QZVK8hPkRzHbtBwBoUj7u252+k4Jp9sNP8 kUoq11CP26cZId+HUfBMUwU3jx4YNDyu+g+mrwGUjeVsWpZQppCw2V/487OzFWTOkPHg7NNRjFz O3CwpRgvtd5/aSgc2oGZIt0DLDapl8oh24J3hLvXyefLn4WxdorteuQC5YuIaGY0UR48zMX8a/y +s7O+7BC64o8l5KxfrQXvee9NUZSQW+xpUp+Dt3Bp9Ok9yeMEewtcH2ZB43atRBjIBMn1LsAZJr klk4j5NjttTEkspMfuU4DeXwjllZVknip9QIWnEZMfc5PmEzRvZ4aj1ce1gf8ToJvQIycoWH5xo OeVBaczFKzgCcdcQn/Fkn51WGqV7tM9YZ6QpjFdVxWrTyW+DrKd8dvzVgfFHX4bGJB5gTbw1BxL m23Rd/D0cYp14jXhZO05RFcZLAvTJDOiet X-Received: by 2002:a05:6214:768:b0:896:fb96:e13c with SMTP id 6a1803df08f44-89979d91197mr276698026d6.57.1772047889659; Wed, 25 Feb 2026 11:31:29 -0800 (PST) Received: from localhost ([2603:7000:c00:3a00:365a:60ff:fe62:ff29]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8cbbf659210sm6749685a.8.2026.02.25.11.31.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Feb 2026 11:31:29 -0800 (PST) Date: Wed, 25 Feb 2026 14:31:28 -0500 From: Johannes Weiner To: Axel Rasmussen Cc: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] Revert "ptdesc: remove references to folios from __pagetable_ctor() and pagetable_dtor()" Message-ID: References: <20260225002434.2953895-1-axelrasmussen@google.com> 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: <20260225002434.2953895-1-axelrasmussen@google.com> 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. > > This regression is visible in master as well as 6.18 stable, so CC > stable too. > > Fixes: f0c92726e89f ("ptdesc: remove references to folios from __pagetable_ctor() and pagetable_dtor()") > Cc: stable@vger.kernel.org > Signed-off-by: Axel Rasmussen Acked-by: Johannes Weiner Willy's cleanup proposal looks good to me too, but this is more straight forward to backport to stable.