[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aXv_5Gl6L-1eXYQd@linux.dev>
Date: Thu, 29 Jan 2026 16:50:57 -0800
From: Shakeel Butt <shakeel.butt@...ux.dev>
To: Johannes Weiner <hannes@...xchg.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Rik van Riel <riel@...riel.com>, Song Liu <songliubraving@...com>,
Kiryl Shutsemau <kas@...nel.org>, Usama Arif <usamaarif642@...il.com>,
David Hildenbrand <david@...nel.org>, Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Zi Yan <ziy@...dia.com>, Baolin Wang <baolin.wang@...ux.alibaba.com>,
"Liam R . Howlett" <Liam.Howlett@...cle.com>, Nico Pache <npache@...hat.com>,
Ryan Roberts <ryan.roberts@....com>, Dev Jain <dev.jain@....com>, Barry Song <baohua@...nel.org>,
Lance Yang <lance.yang@...ux.dev>, Meta kernel team <kernel-team@...a.com>, linux-mm@...ck.org,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: khugepaged: fix NR_FILE_PAGES accounting in
collapse_file()
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.
Powered by blists - more mailing lists