From: Sarthak Sharma <sarthak.sharma@arm.com>
To: Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>, Shuah Khan <shuah@kernel.org>,
Zi Yan <ziy@nvidia.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Nico Pache <nico.pache@linux.dev>,
Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
Anshuman Khandual <anshuman.khandual@arm.com>,
Barry Song <baohua@kernel.org>, Lance Yang <lance.yang@linux.dev>,
Usama Arif <usama.arif@linux.dev>,
Kiryl Shutsemau <kas@kernel.org>,
linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
Sarthak Sharma <sarthak.sharma@arm.com>
Subject: [PATCH 0/4] selftests/mm: replace transhuge-stress with a THP compaction selftest
Date: Thu, 12 Nov 2026 14:32:46 +0530 [thread overview]
Message-ID: <20261112090250.334344-1-sarthak.sharma@arm.com> (raw)
transhuge-stress is a stressor tool that repeatedly
allocates and splits THPs till a specified duration. If the
duration elapses, the test passes and fails only if a setup or
system call fails.
This is not how a test residing in selftests/mm is supposed to
behave. So remove it and add a new functional test called
thp-compaction.c, that allocates THPs as much as it can,
splits those THPs keeping one page retained and discarding
others, and then retries allocating THPs, which will test
if THP compaction is working fine. If we are able to recover
more than half of the initial THPs, the test passes. Otherwise
it fails.
This was suggested by David earlier [1].
Patch 1 removes the current transhuge-stress. Patch 2 adds a check to see
if PFNs are being masked due to no CAP_SYS_ADMIN in the initial user namespace.
Patch 3 factors out THP split helpers from split_huge_page_test.c to vm_util.c.
Patch 4 adds the
new test.
[1] https://lore.kernel.org/all/94ace42d-8d60-4475-953e-74fb3dc23774@kernel.org/
Sarthak Sharma (4):
selftests/mm: remove transhuge-stress
selftests/mm: detect masked PFNs in allocate_transhuge()
selftests/mm: factor out THP split helpers
selftests/mm: add a THP compaction selftest
MAINTAINERS | 2 +-
tools/testing/selftests/mm/Makefile | 2 +-
tools/testing/selftests/mm/ksm_tests.c | 26 ++-
tools/testing/selftests/mm/run_vmtests.sh | 2 +-
.../selftests/mm/split_huge_page_test.c | 45 +---
tools/testing/selftests/mm/thp-compaction.c | 215 ++++++++++++++++++
tools/testing/selftests/mm/transhuge-stress.c | 146 ------------
tools/testing/selftests/mm/vm_util.c | 65 ++++++
tools/testing/selftests/mm/vm_util.h | 6 +
9 files changed, 313 insertions(+), 196 deletions(-)
create mode 100644 tools/testing/selftests/mm/thp-compaction.c
delete mode 100644 tools/testing/selftests/mm/transhuge-stress.c
--
2.53.0
next reply other threads:[~2026-11-12 9:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 9:02 Sarthak Sharma [this message]
2026-11-12 9:02 ` [PATCH 1/4] selftests/mm: remove transhuge-stress Sarthak Sharma
2026-11-12 9:02 ` [PATCH 2/4] selftests/mm: detect masked PFNs in allocate_transhuge() Sarthak Sharma
2026-11-12 9:02 ` [PATCH 3/4] selftests/mm: factor out THP split helpers Sarthak Sharma
2026-11-12 9:02 ` [PATCH 4/4] selftests/mm: add a THP compaction selftest Sarthak Sharma
2026-11-14 12:43 ` [PATCH 0/4] selftests/mm: replace transhuge-stress with " Dev Jain
2026-11-17 7:06 ` Sarthak Sharma
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=20261112090250.334344-1-sarthak.sharma@arm.com \
--to=sarthak.sharma@arm.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=kas@kernel.org \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=nico.pache@linux.dev \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=shuah@kernel.org \
--cc=surenb@google.com \
--cc=usama.arif@linux.dev \
--cc=vbabka@kernel.org \
--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
all inboxes | Powered by JetHome®