linux-yocto/tools/testing/selftests/mm
Donet Tom fae1980347 selftests: hugetlb_dio: fixup check for initial conditions to skip in the start
This test verifies that a hugepage, used as a user buffer for DIO
operations, is correctly freed upon unmapping.  To test this, we read the
count of free hugepages before and after the mmap, DIO, and munmap
operations, then check if the free hugepage count is the same.

Reading free hugepages before the test was removed by commit 0268d45799
('selftests: hugetlb_dio: check for initial conditions to skip at the
start'), causing the test to always fail.

This patch adds back reading the free hugepages before starting the test. 
With this patch, the tests are now passing.

Test results without this patch:

./tools/testing/selftests/mm/hugetlb_dio
TAP version 13
1..4
 # No. Free pages before allocation : 0
 # No. Free pages after munmap : 100
not ok 1 : Huge pages not freed!
 # No. Free pages before allocation : 0
 # No. Free pages after munmap : 100
not ok 2 : Huge pages not freed!
 # No. Free pages before allocation : 0
 # No. Free pages after munmap : 100
not ok 3 : Huge pages not freed!
 # No. Free pages before allocation : 0
 # No. Free pages after munmap : 100
not ok 4 : Huge pages not freed!
 # Totals: pass:0 fail:4 xfail:0 xpass:0 skip:0 error:0

Test results with this patch:

/tools/testing/selftests/mm/hugetlb_dio
TAP version 13
1..4
# No. Free pages before allocation : 100
# No. Free pages after munmap : 100
ok 1 : Huge pages freed successfully !
# No. Free pages before allocation : 100
# No. Free pages after munmap : 100
ok 2 : Huge pages freed successfully !
# No. Free pages before allocation : 100
# No. Free pages after munmap : 100
ok 3 : Huge pages freed successfully !
# No. Free pages before allocation : 100
# No. Free pages after munmap : 100
ok 4 : Huge pages freed successfully !

# Totals: pass:4 fail:0 xfail:0 xpass:0 skip:0 error:0

Link: https://lkml.kernel.org/r/20241110064903.23626-1-donettom@linux.ibm.com
Fixes: 0268d45799 ("selftests: hugetlb_dio: check for initial conditions to skip in the start")
Signed-off-by: Donet Tom <donettom@linux.ibm.com>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-11-12 10:14:00 -08:00
..
.gitignore Random number generator updates for Linux 6.11-rc1. 2024-07-24 10:29:50 -07:00
charge_reserved_hugetlb.sh selftests/mm: fix charge_reserved_hugetlb.sh test 2024-09-03 21:15:46 -07:00
check_config.sh
compaction_test.c selftests/mm: compaction_test: fix off by one in check_compaction() 2024-08-15 22:16:15 -07:00
config
cow.c The usual shower of singleton fixes and minor series all over MM, 2024-05-19 09:21:03 -07:00
droppable.c mm: add MAP_DROPPABLE for designating always lazily freeable mappings 2024-07-19 20:22:12 +02:00
gup_longterm.c The usual shower of singleton fixes and minor series all over MM, 2024-05-19 09:21:03 -07:00
gup_test.c selftests/mm: fix build warnings on ppc64 2024-05-24 11:55:06 -07:00
hmm-tests.c selftests/mm: fix incorrect buffer->mirror size in hmm2 double_map test 2024-10-09 12:47:19 -07:00
hugepage-mmap.c selftests/mm: remove unnecessary ia64 code and comment 2024-09-03 21:15:38 -07:00
hugepage-mremap.c selftests/mm: remove local __NR_* definitions 2024-07-03 19:30:16 -07:00
hugepage-shm.c selftests/mm: remove unnecessary ia64 code and comment 2024-09-03 21:15:38 -07:00
hugepage-vmemmap.c selftests/mm: remove unnecessary ia64 code and comment 2024-09-03 21:15:38 -07:00
hugetlb_dio.c selftests: hugetlb_dio: fixup check for initial conditions to skip in the start 2024-11-12 10:14:00 -08:00
hugetlb_fault_after_madv.c
hugetlb_madv_vs_map.c selftests/mm: hugetlb_madv_vs_map: avoid test skipping by querying hugepage size at runtime 2024-05-11 15:41:37 -07:00
hugetlb_reparenting_test.sh selftests/mm: save and restore nr_hugepages value 2024-02-22 15:38:55 -08:00
hugetlb-madvise.c selftests/mm: skip the hugetlb-madvise tests on unmet hugepage requirements 2024-03-12 13:07:18 -07:00
hugetlb-read-hwpoison.c
hugetlb-soft-offline.c selftest/mm: test enable_soft_offline behaviors 2024-07-04 18:06:00 -07:00
khugepaged.c selftests: mm: fix the incorrect usage() info of khugepaged 2024-10-17 00:28:11 -07:00
ksm_functional_tests.c selftests/mm: remove local __NR_* definitions 2024-07-03 19:30:16 -07:00
ksm_tests.c
madv_populate.c selftests/mm: ksft_exit functions do not return 2024-05-06 13:57:20 -06:00
Makefile ALong with the usual shower of singleton patches, notable patch series in 2024-09-21 07:29:05 -07:00
map_fixed_noreplace.c selftests: mm: make map_fixed_noreplace test names stable 2024-06-15 10:43:07 -07:00
map_hugetlb.c selftests/mm: remove unnecessary ia64 code and comment 2024-09-03 21:15:38 -07:00
map_populate.c
mdwe_test.c Revert "selftests/harness: remove use of LINE_MAX" 2024-05-19 14:36:20 -07:00
memfd_secret.c selftests/mm: remove local __NR_* definitions 2024-07-03 19:30:16 -07:00
migration.c selftests/mm: relax test to fail after 100 migration failures 2024-09-09 16:39:05 -07:00
mkdirty.c selftests/mm: remove local __NR_* definitions 2024-07-03 19:30:16 -07:00
mlock-random-test.c
mlock2-tests.c selftests/mm: parse VMA range in one go 2024-04-25 20:56:07 -07:00
mlock2.h selftests/mm: remove local __NR_* definitions 2024-07-03 19:30:16 -07:00
mrelease_test.c selftests/mm: mrelease_test: conform test to TAP format output 2024-02-22 10:24:49 -08:00
mremap_dontunmap.c selftests/mm: mremap_dontunmap: conform test to TAP format output 2024-02-22 10:24:49 -08:00
mremap_test.c minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
mseal_helpers.h selftests/mm: mseal, self_elf: rename TEST_END_CHECK to REPORT_TEST_PASS 2024-07-03 19:30:07 -07:00
mseal_test.c ALong with the usual shower of singleton patches, notable patch series in 2024-09-21 07:29:05 -07:00
on-fault-limit.c selftests/mm: run_vmtests: remove sudo and conform to tap 2024-02-22 15:38:55 -08:00
pagemap_ioctl.c kselftests: mm: fix wrong __NR_userfaultfd value 2024-09-26 14:01:44 -07:00
pkey_sighandler_tests.c selftests/mm: Add new testcases for pkeys 2024-08-02 14:12:21 +02:00
pkey-arm64.h selftests: mm: make protection_keys test work on arm64 2024-09-04 12:54:06 +01:00
pkey-helpers.h Updates for x86 memory management: 2024-09-17 15:03:01 +02:00
pkey-powerpc.h selftests: mm: make protection_keys test work on arm64 2024-09-04 12:54:06 +01:00
pkey-x86.h selftests: mm: make protection_keys test work on arm64 2024-09-04 12:54:06 +01:00
protection_keys.c Updates for x86 memory management: 2024-09-17 15:03:01 +02:00
run_vmtests.sh selftests/mm: remove unnecessary ia64 code and comment 2024-09-03 21:15:38 -07:00
seal_elf.c selftests: mm: fix build errors on armhf 2024-09-01 17:58:59 -07:00
settings
soft-dirty.c selftests/mm: ksft_exit functions do not return 2024-05-06 13:57:20 -06:00
split_huge_page_test.c mm: selftest to verify zero-filled pages are mapped to zeropage 2024-09-09 16:39:03 -07:00
test_hmm.sh
test_vmalloc.sh
thp_settings.c selftests: mm: support shmem mTHP collapse testing 2024-09-03 21:15:39 -07:00
thp_settings.h selftests: mm: support shmem mTHP collapse testing 2024-09-03 21:15:39 -07:00
thuge-gen.c selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
transhuge-stress.c selftests/mm: transhuge-stress: conform to TAP format output 2024-02-22 10:24:49 -08:00
uffd-common.c Revert "selftests/mm: replace atomic_bool with pthread_barrier_t" 2024-10-28 21:40:41 -07:00
uffd-common.h Revert "selftests/mm: replace atomic_bool with pthread_barrier_t" 2024-10-28 21:40:41 -07:00
uffd-stress.c mm: turn off test_uffdio_wp if CONFIG_PTE_MARKER_UFFD_WP is not configured. 2024-07-04 18:05:58 -07:00
uffd-unit-tests.c selftests/mm: fix deadlock for fork after pthread_create with atomic_bool 2024-10-28 21:40:41 -07:00
va_high_addr_switch.c selftests/mm: skip test for non-LPA2 and non-LVA systems 2024-07-26 14:33:10 -07:00
va_high_addr_switch.sh selftests/mm: va_high_addr_switch: reduce test noise 2024-07-03 19:29:56 -07:00
virtual_address_range.c selftests/mm: confirm VA exhaustion without reliance on correctness of mmap() 2024-04-25 20:56:01 -07:00
vm_util.c mm: selftest to verify zero-filled pages are mapped to zeropage 2024-09-09 16:39:03 -07:00
vm_util.h mm: selftest to verify zero-filled pages are mapped to zeropage 2024-09-09 16:39:03 -07:00
write_hugetlb_memory.sh
write_to_hugetlbfs.c selftests/mm: fix charge_reserved_hugetlb.sh test 2024-09-03 21:15:46 -07:00