[LTP] [PATCH 1/2] move_pages12: Ignore ENOMEM from madvise(MADV_SOFT_OFFLINE)

Li Wang liwang@redhat.com
Thu Mar 20 02:42:49 CET 2025


Hi Martin,

I had ever added a compressed memory step to dis fragmental
before doing hugepage allocations (in commit e97f41970582 ),
but that didn't seem to solve the problem ideally.

Anyway, this patch looks good.
Reviewed-by: Li Wang <liwang@redhat.com>


On Thu, Mar 20, 2025 at 1:25 AM Martin Doucha <mdoucha@suse.cz> wrote:

> The test dissolves hugepages which results in soft-offline madvise() call
> returning ENOMEM after a few iterations. This is expected behavior.
> However,
> trying to preallocate more hugepages to prevent the error will break
> the ability to reproduce the SIGBUS bug. Simply ignoring the ENOMEM error
> is good enough.
>
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>  testcases/kernel/syscalls/move_pages/move_pages12.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/move_pages/move_pages12.c
> b/testcases/kernel/syscalls/move_pages/move_pages12.c
> index 879a89b6f..a5454b1ec 100644
> --- a/testcases/kernel/syscalls/move_pages/move_pages12.c
> +++ b/testcases/kernel/syscalls/move_pages/move_pages12.c
> @@ -100,7 +100,7 @@ static void *addr;
>  static int do_soft_offline(int tpgs)
>  {
>         if (madvise(addr, tpgs * hpsz, MADV_SOFT_OFFLINE) == -1) {
> -               if (errno != EINVAL && errno != EBUSY)
> +               if (errno != EINVAL && errno != EBUSY && errno != ENOMEM)
>                         tst_res(TFAIL | TERRNO, "madvise failed");
>                 return errno;
>         }
> --
> 2.47.0
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
>

-- 
Regards,
Li Wang


More information about the ltp mailing list