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/20240306223714.320681-4-npache@redhat.com Signed-off-by: Nico Pache <npache@redhat.com> Cc: Ben Hutchings <ben@decadent.org.uk> Cc: Muchun Song <muchun.song@linux.dev> Cc: Muhammad Usama Anjum <usama.anjum@collabora.com> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 5a6aa60 commit 84d147d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)