mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/3] selftests/mm: TAP output and global-state fixes
@ 2026-08-25  8:57 Song Hu
  2026-08-25  8:57 ` [PATCH v4 1/3] selftests/mm: emit TAP header in uffd-wp-mremap Song Hu
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Song Hu @ 2026-08-25  8:57 UTC (permalink / raw)
  To: akpm, usama.anjum
  Cc: linux-mm, shuah, david, ljs, liam, vbabka, rppt, surenb, mhocko,
	peterx, sarthak.sharma, linux-kselftest, linux-kernel, Song Hu

uffd-wp-mremap and mremap_test never print the TAP header (and mremap_test
skips with a bare exit(KSFT_SKIP) rather than a KTAP skip), so their output
is not valid KTAP; hugetlb-soft-offline toggles enable_soft_offline during
the run and leaves it disabled afterwards.

Tested on x86_64.

Song Hu (3):
  selftests/mm: emit TAP header in uffd-wp-mremap
  selftests/mm: emit TAP header and use TAP skip in mremap_test
  selftests/mm: restore enable_soft_offline in hugetlb-soft-offline

 tools/testing/selftests/mm/hugetlb-soft-offline.c | 49 +++++++++++++----------
 tools/testing/selftests/mm/mremap_test.c          | 43 +++++++++++++---------
 tools/testing/selftests/mm/uffd-wp-mremap.c       |   2 +
 3 files changed, 55 insertions(+), 39 deletions(-)

---

Changes in v4, per review of v3 patch 3/3:

- hugetlb-soft-offline: the atexit restore handler no longer uses
  write_num(); on failure it re-enters exit() through
  ksft_exit_fail_msg(), undefined behavior from inside an atexit
  handler.  Restore with plain open()/write(), best effort.

Changes in v3, per Usama Anjum's review of v2 patch 2/3:

- mremap_test: cache mmap_min_addr in main() before ksft_set_plan(),
  so the skip paths in get_mmap_min_addr() are taken before the plan
  is set; a skip after the plan leaves the run with fewer tests than
  planned.

Changes in v2, per review feedback from Mike Rapoport, Sarthak Sharma and
the Sashiko AI review Andrew Morton pointed at:

- mremap_test: save errno before fclose() in get_mmap_min_addr() so
  strerror() reports the actual failure, and split the ksft_*() messages
  embedding "\n\t" so continuation lines get the "# " prefix.

- hugetlb-soft-offline: restore enable_soft_offline from an atexit()
  handler so it also runs on early exits, and use read_num()/write_num()
  from vm_util instead of the hand-rolled helpers.

v3: https://lore.kernel.org/all/20260820061426.356869-1-husong@kylinos.cn/
v2: https://lore.kernel.org/all/20260815080716.3596514-1-husong@kylinos.cn/
v1: https://lore.kernel.org/all/20260812120821.523860-1-husong@kylinos.cn/

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

end of thread, other threads:[~2026-09-10  9:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-25  8:57 [PATCH v4 0/3] selftests/mm: TAP output and global-state fixes Song Hu
2026-08-25  8:57 ` [PATCH v4 1/3] selftests/mm: emit TAP header in uffd-wp-mremap Song Hu
2026-09-10  9:28   ` David Hildenbrand (Arm)
2026-08-25  8:57 ` [PATCH v4 2/3] selftests/mm: emit TAP header and use TAP skip in mremap_test Song Hu
2026-09-10  9:33   ` David Hildenbrand (Arm)
2026-08-25  8:57 ` [PATCH v4 3/3] selftests/mm: restore enable_soft_offline in hugetlb-soft-offline Song Hu
2026-08-25  9:06   ` Song Hu
2026-08-25  9:24   ` Muhammad Usama Anjum
2026-09-10  9:36   ` David Hildenbrand (Arm)

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®