Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/5] Test readback from fd on hugetlbfs mount
@ 2026-05-18 18:17 Ackerley Tng via B4 Relay
  2026-05-18 18:17 ` [PATCH RFC 1/5] mm: selftests: Inline check_bytes() function into caller Ackerley Tng via B4 Relay
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Ackerley Tng via B4 Relay @ 2026-05-18 18:17 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Shuah Khan, muchun.song,
	osalvador
  Cc: linux-mm, linux-kselftest, linux-kernel, Ackerley Tng

Hi,

I'm thinking of consolidating the tests for libhugetlbfs as kernel
selftests, and to start that off, I picked the simplest test:
tests/readback.c

I refactored hugepage-mmap.c to use the kselftest harness, and then used
FIXTURE_VARIANT from the harness to port in testing readback from an fd on
a hugetlbfs mount.

This output shows that the original test behavior was retained for the
memfd part:

  # ./hugepage-mmap
  TAP version 13
  1..1
  # Returned address is 0x7f312f200000
  # First hex is 0
  # First hex is 3020100
  ok 1 Read same data
  # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0

  # ./hugepage-mmap
  TAP version 13
  1..1
  # Starting 1 tests from 1 test cases.
  #  RUN           hugepage_mmap.read_write ...
  # hugepage-mmap.c:41:read_write:Returned address is 0x7f19f3a00000
  # hugepage-mmap.c:54:read_write:First hex is 0
  # hugepage-mmap.c:59:read_write:First hex is 3020100
  #            OK  hugepage_mmap.read_write
  ok 1 hugepage_mmap.read_write
  # PASSED: 1 / 1 tests passed.
  # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0

Let me know what you think before I genericize the 2M hugepage size to
other sizes!

Signed-off-by: Ackerley Tng <ackerleytng@google.com>
---
Ackerley Tng (5):
      mm: selftests: Inline check_bytes() function into caller
      mm: selftests: Inline {read,write}_bytes functions
      mm: selftests: Refactor hugepage-mmap to use kselftest harness
      mm: selftests: Update hugepage-mmap to support hugetlbfs mount
      mm: selftests: Port readback test logic from libhugetlbfs

 tools/testing/selftests/mm/hugepage-mmap.c | 143 +++++++++++++++++++++--------
 1 file changed, 105 insertions(+), 38 deletions(-)
---
base-commit: 66edb901bf874d9e0787326ba12d3548b2da8700
change-id: 20260503-port-hugetlb-selftests-9bc63bde5116

Best regards,
--
Ackerley Tng <ackerleytng@google.com>




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

end of thread, other threads:[~2026-05-19 13:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18 18:17 [PATCH RFC 0/5] Test readback from fd on hugetlbfs mount Ackerley Tng via B4 Relay
2026-05-18 18:17 ` [PATCH RFC 1/5] mm: selftests: Inline check_bytes() function into caller Ackerley Tng via B4 Relay
2026-05-18 18:17 ` [PATCH RFC 2/5] mm: selftests: Inline {read,write}_bytes functions Ackerley Tng via B4 Relay
2026-05-18 18:17 ` [PATCH RFC 3/5] mm: selftests: Refactor hugepage-mmap to use kselftest harness Ackerley Tng via B4 Relay
2026-05-18 18:17 ` [PATCH RFC 4/5] mm: selftests: Update hugepage-mmap to support hugetlbfs mount Ackerley Tng via B4 Relay
2026-05-18 18:17 ` [PATCH RFC 5/5] mm: selftests: Port readback test logic from libhugetlbfs Ackerley Tng via B4 Relay
2026-05-19  5:32 ` [PATCH RFC 0/5] Test readback from fd on hugetlbfs mount Mike Rapoport
2026-05-19 13:23 ` tarunsahu

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