Skip to content

Commit 84d147d

Browse files
PacheNicoakpm00
authored andcommitted
selftests/mm: skip the hugetlb-madvise tests on unmet hugepage requirements
Now that run_vmtests.sh does not guarantee that the correct hugepage count is available, skip the hugetlb-madvise test if the requirements are not met rather than failing. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Nico Pache <[email protected]> Cc: Ben Hutchings <[email protected]> Cc: Muchun Song <[email protected]> Cc: Muhammad Usama Anjum <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 5a6aa60 commit 84d147d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/testing/selftests/mm/hugetlb-madvise.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <sys/mman.h>
2020
#include <fcntl.h>
2121
#include "vm_util.h"
22+
#include "../kselftest.h"
2223

2324
#define MIN_FREE_PAGES 20
2425
#define NR_HUGE_PAGES 10 /* common number of pages to map/allocate */
@@ -78,7 +79,7 @@ int main(int argc, char **argv)
7879
free_hugepages = get_free_hugepages();
7980
if (free_hugepages < MIN_FREE_PAGES) {
8081
printf("Not enough free huge pages to test, exiting!\n");
81-
exit(1);
82+
exit(KSFT_SKIP);
8283
}
8384

8485
fd = memfd_create(argv[0], MFD_HUGETLB);

0 commit comments

Comments
 (0)