[LTP] [PATCH v4] mmap22.c: Test for new MAP_DROPPABLE flag for mmap

Jan Stancek jstancek@redhat.com
Mon May 12 10:43:55 CEST 2025


Is anyone else seeing this test failing on recent 6.15-rc5 kernels?

==== mmap22 ====
command: mmap22
tst_tmpdir.c:316: TINFO: Using /tmp/LTP_mmazCULNN as tmpdir (tmpfs filesystem)
tst_test.c:1938: TINFO: LTP version: 20250130-253-g4a0e3a8fa
tst_test.c:1942: TINFO: Tested kernel:
6.15.0-0.rc5.250509g9c69f8884904.47.eln148.x86_64 #1 SMP
PREEMPT_DYNAMIC Fri May  9 15:17:31 UTC 2025 x86_64
tst_kconfig.c:88: TINFO: Parsing kernel config
'/lib/modules/6.15.0-0.rc5.250509g9c69f8884904.47.eln148.x86_64/build/.config'
tst_test.c:1758: TINFO: Overall timeout per run is 0h 05m 54s
mmap22.c:55: TFAIL: MAP_DROPPABLE did not drop memory within the timeout period.



On Wed, May 7, 2025 at 5:25 PM Cyril Hrubis <chrubis@suse.cz> wrote:
>
> Hi!
> Pushed with a minor change, thanks.
>
> We should check if the addr is valid before we attemp to unmap it in the
> setup() so I've added:
>
> diff --git a/testcases/kernel/syscalls/mmap/mmap22.c b/testcases/kernel/syscalls/mmap/mmap22.c
> index bfef559e4..0e589dfab 100644
> --- a/testcases/kernel/syscalls/mmap/mmap22.c
> +++ b/testcases/kernel/syscalls/mmap/mmap22.c
> @@ -72,8 +72,13 @@ static void setup(void)
>  {
>         void *addr = mmap(0, 1, PROT_READ | PROT_WRITE,
>                         MAP_ANONYMOUS | MAP_DROPPABLE, -1, 0);
> +
>         if (addr == MAP_FAILED && errno == EINVAL)
> -               tst_brk(TCONF, "MAP_DROPPABLE not support");
> +               tst_brk(TCONF, "MAP_DROPPABLE not supported");
> +
> +       if (addr == MAP_FAILED)
> +               tst_brk(TBROK | TERRNO, "mmap() MAP_DROPPABLE failed");
> +
>         SAFE_MUNMAP(addr, 1);
>  }
>
>
> --
> Cyril Hrubis
> chrubis@suse.cz
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>



More information about the ltp mailing list