linux/tools/testing
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
..
crypto/chacha20-s390
cxl cxl/test: Improve init-order fidelity relative to real-world systems 2024-10-25 16:07:04 -05:00
fault-injection failcmd: make failcmd.sh executable 2024-09-01 20:43:32 -07:00
ktest ktest.pl: Avoid false positives with grub2 skip regex 2024-09-04 15:06:28 -04:00
kunit kunit: tool: Build compile_commands.json 2024-09-12 09:52:36 -06:00
memblock memblock: updates for 6.12-rc1 2024-09-25 11:35:19 -07:00
nvdimm
radix-tree maple_tree: add regression test for spanning store bug 2024-10-17 08:35:10 -07:00
scatterlist
selftests selftests: hugetlb_dio: fixup check for initial conditions to skip in the start 2024-11-12 10:14:00 -08:00
shared 19 hotfixes. 13 are cc:stable. 2024-09-27 10:27:22 -07:00
vma tools: testing: add expand-only mode VMA test 2024-10-28 21:40:40 -07:00
vsock test/vsock: add ioctl unsent bytes test 2024-08-02 09:20:28 +01:00