[PATCH v2 0/3] selftests/mm: assorted fixes for hmm-tests

From: Aboorva Devarajan

Date: Tue May 19 2026 - 00:07:39 EST


Hi all,

This series fixes a few issues in hmm-tests that show up when
page-size and huge-page configuration differ from the hardcoded
assumptions the tests were written for (PMD/THP sizing, default
hugepage size, and related cases).

It also includes a fix to exclusive_cow: the test ignored the return
value of fork(), so both parent and child ran the same teardown path.

v1: https://lore.kernel.org/all/cover.1777870179.git.aboorvad@xxxxxxxxxxxxx/

Changes in v2:
- Patches 1 and 3 are unchanged.
- Patch 2: fall back to TWOMEG when read_pmd_pagesize() returns zero,
use a fixed-size array to avoid non-constant initialisers, and skip
benchmark sizes that exceed INT_MAX instead of capping the THP count
at runtime.

Please let us know if you have any comments.

Thanks,
Aboorva

Aboorva Devarajan (1):
selftests/mm: fix exclusive_cow test fork() handling

Sayali Patil (2):
selftests/mm: allow PUD-level entries in compound testcase of hmm
tests
selftests/mm: remove hardcoded THP sizing assumptions in hmm tests

tools/testing/selftests/mm/hmm-tests.c | 104 ++++++++++++++++++-------
1 file changed, 76 insertions(+), 28 deletions(-)

--
2.54.0