Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] selftests/mm: replace transhuge-stress with a THP compaction selftest
@ 2026-11-12  9:02 Sarthak Sharma
  2026-11-12  9:02 ` [PATCH 1/4] selftests/mm: remove transhuge-stress Sarthak Sharma
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Sarthak Sharma @ 2026-11-12  9:02 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand
  Cc: Lorenzo Stoakes, Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Shuah Khan, Zi Yan, Baolin Wang,
	Nico Pache, Ryan Roberts, Dev Jain, Anshuman Khandual, Barry Song,
	Lance Yang, Usama Arif, Kiryl Shutsemau, linux-mm,
	linux-kselftest, linux-kernel, Sarthak Sharma

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-13  9:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12  9:02 [PATCH 0/4] selftests/mm: replace transhuge-stress with a THP compaction selftest Sarthak Sharma
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-13  9:03   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox