From 6e676df0dd3342422749f1dfb44371d93641db1f Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 24 Apr 2024 13:20:21 -0700 Subject: [PATCH] Skip madvise_fracture_flags test if CONFIG_TRANSPARENT_HUGEPAGE is disabled --- src/test/madvise_fracture_flags.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/madvise_fracture_flags.c b/src/test/madvise_fracture_flags.c index 85f57039ab3..25adeabf48c 100644 --- a/src/test/madvise_fracture_flags.c +++ b/src/test/madvise_fracture_flags.c @@ -36,6 +36,11 @@ int main(__attribute__((unused)) int argc, __attribute__((unused)) char** argv) char *probe_map = mmap(NULL, PROBE_REGION_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); test_assert(probe_map != MAP_FAILED); ret = madvise(probe_map, PROBE_REGION_SIZE, MADV_HUGEPAGE); + if (ret == -1 && errno == EINVAL) { + atomic_puts("Skipping test: CONFIG_TRANSPARENT_HUGEPAGE is disabled"); + atomic_puts("EXIT-SUCCESS"); + return 77; + } test_assert(ret == 0); ret = madvise(probe_map, PROBE_REGION_SIZE, MADV_DONTDUMP); test_assert(ret == 0);