From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (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 22C473033D2 for ; Fri, 30 Jan 2026 00:51:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769734278; cv=none; b=sGtRJ44qEVDyXIknkHWp9VGCz/PmvK4BfYzVDWn1c+NC8ZKVbf0U/QO7fsx9djHcOpfZickpJU8I+iVJ7bNA3wpclWzw/mc6rSdJsroUUE57PGYpkKXfXI9f2Mdu2jR9nsl7DZ2WRxVXCMHqnMOwzVBgnlAX3FekLobUzbIPpRs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769734278; c=relaxed/simple; bh=6YUrVNS2AcKSw9HSyU5YL7g03O3wVPFbJE99k3TJ5BE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Aie0Fz9ynJzZdZZyeItiAeYM6UchggM+3X5Hl01h6b041fFutLS+8KxSJUyCnMSSdjEn82BlNl4xOIzJxpzQm0aobC7u8aXJ3gEURLC8/LlZxWZin+Mq30zl1tf7BnMQtylBLA5gNpcyUJjyd3F+r1mQDE2sQYNxnc7SbptcV3Y= 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=Z/FaQ/kg; arc=none smtp.client-ip=91.218.175.189 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="Z/FaQ/kg" Date: Thu, 29 Jan 2026 16:50:57 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1769734262; 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=3beR78siDEEmK2spAD/HgnCu/E4OotAxU6+k9E99kQg=; b=Z/FaQ/kgxOCkIdV9pj9isA31VgQFflC/MoNR38FryrcwIrK5Mas3RvcmCHNpwvvJWp4BSU u1jPf1N0mdSlIcRcEclZA5y4KSScu2Y3nwpAt87BQPqOY1spg5dQd3LjSS2HtQs5A6NZsX JDGHWhKyhKG9PMhWjxlqmTcvcshg0Ig= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Johannes Weiner Cc: Andrew Morton , Rik van Riel , Song Liu , Kiryl Shutsemau , Usama Arif , David Hildenbrand , Lorenzo Stoakes , Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Meta kernel team , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: khugepaged: fix NR_FILE_PAGES accounting in collapse_file() Message-ID: References: <20260129184054.910897-1-shakeel.butt@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: X-Migadu-Flow: FLOW_OUT On Thu, Jan 29, 2026 at 07:32:14PM -0500, Johannes Weiner wrote: > On Thu, Jan 29, 2026 at 10:40:54AM -0800, Shakeel Butt wrote: > > @@ -2200,8 +2200,8 @@ static enum scan_result collapse_file(struct mm_struct *mm, unsigned long addr, > > else > > lruvec_stat_mod_folio(new_folio, NR_FILE_THPS, HPAGE_PMD_NR); > > > > + lruvec_stat_mod_folio(new_folio, NR_FILE_PAGES, HPAGE_PMD_NR); > > The memcg breakage is more visible, but I think this has been broken > for NUMA stats even longer. new_folio could also come from a different > node than the subpages, after all. Indeed you are right, so I should blame Kiryl instead of Song :P > > > if (nr_none) { > > - lruvec_stat_mod_folio(new_folio, NR_FILE_PAGES, nr_none); > > /* nr_none is always 0 for non-shmem. */ > > lruvec_stat_mod_folio(new_folio, NR_SHMEM, nr_none); > > So AFAICT NR_SHMEM needs the same treatment. > > It looks like that's been broken since f3f0e1d2150b ("khugepaged: add > support of collapse for tmpfs/shmem pages"). Thanks, I will send v2 with correct handling of NR_SHMEM as well.