Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Nico Pache <npache@redhat.com>, Linux MM <linux-mm@kvack.org>,
	linux-kselftest@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	linux-cxl@vger.kernel.org
Cc: "Lorenzo Stoakes (Oracle)" <ljs@kernel.org>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Zi Yan <ziy@nvidia.com>, Matthew Brost <matthew.brost@intel.com>,
	Joshua Hahn <joshua.hahnjy@gmail.com>,
	Rakie Kim <rakie.kim@sk.com>, Byungchul Park <byungchul@sk.com>,
	Gregory Price <gourry@gourry.net>,
	Ying Huang <ying.huang@linux.alibaba.com>,
	Alistair Popple <apopple@nvidia.com>
Subject: Re: [Bug Report] Elevated PMD nr_anon after running selftests
Date: Thu, 11 Jun 2026 18:23:52 +0200	[thread overview]
Message-ID: <58760bd8-4979-4fb1-96a3-eb94f0e8ca0c@kernel.org> (raw)
In-Reply-To: <7e7cbc60-e9c7-4a63-9d4b-4e8fcad7bfc0@kernel.org>

On 6/11/26 18:09, David Hildenbrand (Arm) wrote:
> On 6/11/26 17:58, Nico Pache wrote:
>> Hi,
>>
>> While testing my mTHP code I noticed that mm selftests caused an accounting error in
>> /sys/kernel/mm/transparent_hugepage/hugepages-2048kB/stats/nr_anon
>>
>> At first I thought I might have caused a regression, but when retesting with 7.1-rc5 (without my code), the issue was still present.
>>
>> This issue occurs in two mm selftests:
>> 1) hmm test
>> 2) migration - private_anon_htlb test
>>
>> I spoke to David about this and he suggested the following diff which seems to have solved both issues.
>>
>> David would you like to send a formal patch or patches?
>>
>> Cheers,
>> -- Nico
>>
>> Diff for (1)
>>
>> diff --git a/mm/memremap.c b/mm/memremap.c
>> index 053842d45cb1..683a77dd679d 100644
>> --- a/mm/memremap.c
>> +++ b/mm/memremap.c
>> @@ -425,6 +425,7 @@ void free_zone_device_folio(struct folio *folio)
>>         mem_cgroup_uncharge(folio);
>>
>>         if (folio_test_anon(folio)) {
>> +               mod_mthp_stat(folio_order(folio), MTHP_STAT_NR_ANON, -1);
>>                 for (i = 0; i < nr; i++)
>>                         __ClearPageAnonExclusive(folio_page(folio, i));
>>         }
> 
> Wasn't there another issue with hugetlb?

Just realized that you sent this, but somehow my mail client got confused and
hid it.

-- 
Cheers,

David

  reply	other threads:[~2026-06-11 16:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 15:58 [Bug Report] Elevated PMD nr_anon after running selftests Nico Pache
2026-06-11 16:09 ` David Hildenbrand (Arm)
2026-06-11 16:23   ` David Hildenbrand (Arm) [this message]
2026-06-11 16:38     ` Nico Pache
2026-06-12 11:22   ` Nico Pache
2026-06-11 16:39 ` Lorenzo Stoakes
2026-06-11 17:24   ` Nico Pache

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58760bd8-4979-4fb1-96a3-eb94f0e8ca0c@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=byungchul@sk.com \
    --cc=gourry@gourry.net \
    --cc=joshua.hahnjy@gmail.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=matthew.brost@intel.com \
    --cc=npache@redhat.com \
    --cc=osalvador@suse.de \
    --cc=rakie.kim@sk.com \
    --cc=ying.huang@linux.alibaba.com \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox