selftests: mincore: fix tmpfs mincore test failureWhen running mincore test cases, I encountered the following failures:"mincore_selftest.c:359:check_tmpfs_mmap:Expected ra_pages (511) == 0 (0)
selftests: mincore: fix tmpfs mincore test failureWhen running mincore test cases, I encountered the following failures:"mincore_selftest.c:359:check_tmpfs_mmap:Expected ra_pages (511) == 0 (0)mincore_selftest.c:360:check_tmpfs_mmap:Read-ahead pages found in memorycheck_tmpfs_mmap: Test terminated by assertion FAIL global.check_tmpfs_mmapnot ok 5 global.check_tmpfs_mmapFAILED: 4 / 5 tests passed"The reason for the test case failure is that my system automatically enabledtmpfs large folio allocation by adding the 'transparent_hugepage_tmpfs=always'cmdline. However, the test case still expects the tmpfs mounted on /dev/shm toallocate small folios, which leads to assertion failures when verifying readaheadpages.As discussed with David, there's no reason to continue checking the readaheadlogic for tmpfs. Drop it to fix this issue.Link: https://lkml.kernel.org/r/9a00856cc6a8b4e46f4ab8b1af11ce5fc1a31851.1744025467.git.baolin.wang@linux.alibaba.comFixes: d635ccdb435c ("mm: shmem: add a kernel command line to change the default huge policy for tmpfs")Signed-off-by: Baolin Wang <[email protected]>Acked-by: Zi Yan <[email protected]>Acked-by: David Hildenbrand <[email protected]>Cc: Barry Song <[email protected]>Cc: Hugh Dickins <[email protected]>Cc: Matthew Wilcox (Oracle) <[email protected]>Cc: Ryan Roberts <[email protected]>Signed-off-by: Andrew Morton <[email protected]>
show more ...
selftests/mincore: Allow read-ahead pages to reach the end of the fileWhen running the mincore_selftest on a system with an XFS file system, itfailed the "check_file_mmap" test case due to the rea
selftests/mincore: Allow read-ahead pages to reach the end of the fileWhen running the mincore_selftest on a system with an XFS file system, itfailed the "check_file_mmap" test case due to the read-ahead pages reachingthe end of the file. The failure log is as below: RUN global.check_file_mmap ... mincore_selftest.c:264:check_file_mmap:Expected i (1024) < vec_size (1024) mincore_selftest.c:265:check_file_mmap:Read-ahead pages reached the end of the file check_file_mmap: Test failed FAIL global.check_file_mmapThis is because the read-ahead window size of the XFS file system on thismachine is 4 MB, which is larger than the size from the #PF address to theend of the file. As a result, all the pages for this file are populated. blockdev --getra /dev/nvme0n1p5 8192 blockdev --getbsz /dev/nvme0n1p5 512This issue can be fixed by extending the current FILE_SIZE 4MB to a largernumber, but it will still fail if the read-ahead window size of the filesystem is larger enough. Additionally, in the real world, read-ahead pagesreaching the end of the file can happen and is an expected behavior.Therefore, allowing read-ahead pages to reach the end of the file is abetter choice for the "check_file_mmap" test case.Link: https://lore.kernel.org/r/[email protected]Reported-by: Yi Lai <[email protected]>Signed-off-by: Qiuxu Zhuo <[email protected]>Signed-off-by: Shuah Khan <[email protected]>
selftests/mincore: fix skip condition for check_huge_pages testThe check_huge_pages test was failing instead of skipping on qemu-armv7because the skip condition wasn't handled properly. Add an add
selftests/mincore: fix skip condition for check_huge_pages testThe check_huge_pages test was failing instead of skipping on qemu-armv7because the skip condition wasn't handled properly. Add an additionalcheck to fix it.Signed-off-by: Ricardo Cañuelo <[email protected]>Reported-by: Naresh Kamboju <[email protected]>Reported-by: Linux Kernel Functional Testing <[email protected]>Reviewed-by: Muhammad Usama Anjum <[email protected]>Tested-by: Anders Roxell <[email protected]>Closes: https://lore.kernel.org/all/CA+G9fYuoB8Ug8PcTU-YGmemL7_eeEksXFihvxWF6OikD7sK7pA@mail.gmail.comSigned-off-by: Shuah Khan <[email protected]>
selftests: skip mincore.check_file_mmap when fs lacks needed supportReport mincore.check_file_mmap as SKIP instead of FAIL if the underlyingfilesystem lacks support of O_TMPFILE or fallocate since
selftests: skip mincore.check_file_mmap when fs lacks needed supportReport mincore.check_file_mmap as SKIP instead of FAIL if the underlyingfilesystem lacks support of O_TMPFILE or fallocate since such failuresare not really related to mincore functionality.Cc: Ricardo Cañuelo <[email protected]>Signed-off-by: Cristian Marussi <[email protected]>Signed-off-by: Shuah Khan <[email protected]>
selftests: remove duplicate include'assert.h' included in 'sparsebit.c' is duplicated.It is also included in the 161th line.'string.h' included in 'mincore_selftest.c' is duplicated.It is also i
selftests: remove duplicate include'assert.h' included in 'sparsebit.c' is duplicated.It is also included in the 161th line.'string.h' included in 'mincore_selftest.c' is duplicated.It is also included in the 15th line.'sched.h' included in 'tlbie_test.c' is duplicated.It is also included in the 33th line.Link: https://lkml.kernel.org/r/[email protected]Signed-off-by: Zhang Yunkai <[email protected]>Cc: Paolo Bonzini <[email protected]>Cc: Shuah Khan <[email protected]>Signed-off-by: Andrew Morton <[email protected]>Signed-off-by: Linus Torvalds <[email protected]>
selftests: add mincore() testsAdd a test suite for the mincore() syscall. It tests most of its usecases as well as its interface.Tests implemented: - basic interface test - behavior on ano
selftests: add mincore() testsAdd a test suite for the mincore() syscall. It tests most of its usecases as well as its interface.Tests implemented: - basic interface test - behavior on anonymous mappings - behavior on anonymous mappings with huge tlb pages - file-backed mapping with a regular file - file-backed mapping with a tmpfs fileSigned-off-by: Ricardo Cañuelo <[email protected]>Signed-off-by: Andrew Morton <[email protected]>Link: http://lkml.kernel.org/r/[email protected]Signed-off-by: Linus Torvalds <[email protected]>