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

Edward Liaw edliaw@google.com
Fri Nov 3 16:54:26 CET 2023


Hi Cyril,

On Fri, Nov 3, 2023 at 3:47 AM Cyril Hrubis <chrubis@suse.cz> wrote:
>
> 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,
>
>
> --

Yeah, that makes more sense to me.

> Cyril Hrubis
> chrubis@suse.cz


More information about the ltp mailing list