[PATCH 0/3] selftests/mm: TAP output and global-state fixes

Song Hu posted 3 patches 1 month, 2 weeks ago
There is a newer version of this series
.../selftests/mm/hugetlb-soft-offline.c       | 24 +++++++++++++++++++
tools/testing/selftests/mm/mremap_test.c      | 15 ++++++------
tools/testing/selftests/mm/uffd-wp-mremap.c   |  2 ++
3 files changed, 33 insertions(+), 8 deletions(-)
[PATCH 0/3] selftests/mm: TAP output and global-state fixes
Posted by Song Hu 1 month, 2 weeks ago
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

 .../selftests/mm/hugetlb-soft-offline.c       | 24 +++++++++++++++++++
 tools/testing/selftests/mm/mremap_test.c      | 15 ++++++------
 tools/testing/selftests/mm/uffd-wp-mremap.c   |  2 ++
 3 files changed, 33 insertions(+), 8 deletions(-)

-- 
2.43.0
Re: [PATCH 0/3] selftests/mm: TAP output and global-state fixes
Posted by Andrew Morton 1 month, 2 weeks ago
On Wed, 12 Aug 2026 20:08:18 +0800 Song Hu <husong@kylinos.cn> wrote:

> 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.

Thanks.  AI review found a couple of minor error-path issues, both of
which look legitimate to me.
	https://sashiko.dev/#/patchset/20260812120821.523860-1-husong@kylinos.cn
Re: [PATCH 0/3] selftests/mm: TAP output and global-state fixes
Posted by Song Hu 1 month, 2 weeks ago
Hi, Andrew

在 2026/8/13 04:51, Andrew Morton 写道:
> On Wed, 12 Aug 2026 20:08:18 +0800 Song Hu <husong@kylinos.cn> wrote:
> 
>> 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.
> 
> Thanks.  AI review found a couple of minor error-path issues, both of
> which look legitimate to me.
> 	https://sashiko.dev/#/patchset/20260812120821.523860-1-husong@kylinos.cn

Agreed, both will be fixed in v2:

- hugetlb-soft-offline: restore via atexit() so it also runs on
  ksft_exit_fail_msg() exits, and use read_num()/write_num() per Mike's
  comment.

- mremap_test: save errno before fclose() in get_mmap_min_addr().

Thanks,
Song