[LTP] [PATCH] madvise11: Allow test to skip if MADV_SOFT_OFFLINE is not supported

Cyril Hrubis chrubis@suse.cz
Fri Nov 3 11:47:57 CET 2023


Hi!
> madvise11 will exit with TFAIL if CONFIG_MEMORY_FAILURE is not
> configured.  Skip the TFAIL if EINVAL is returned by madvise.

Does it make sense to keep the test running if the config option is not
present? As far as I can tell we are trying to reproduce a race there
that depends on the madvise being able to soft offline the pages.

What about this then?

diff --git a/testcases/kernel/syscalls/madvise/madvise11.c b/testcases/kernel/syscalls/madvise/madvise11.c
index 74caadc44..50ab935c9 100644
--- a/testcases/kernel/syscalls/madvise/madvise11.c
+++ b/testcases/kernel/syscalls/madvise/madvise11.c
@@ -426,6 +426,10 @@ static struct tst_test test = {
                "rmmod",
                NULL
        },
+       .needs_kconfigs = (const char *[]) {
+                "CONFIG_MEMORY_FAILURE=y",
+                NULL
+        },
        .max_runtime = 30,
        .needs_checkpoints = 1,
        .setup = setup,


-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list