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

Wei Gao wegao@suse.com
Tue May 13 17:44:07 CEST 2025


On Mon, May 12, 2025 at 10:43:55AM +0200, Jan Stancek wrote:
> 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.
> 

I have tested rc5/6 and both give pass result.

uname  -r
6.15.0-rc6-g627277ba7c23
 ./mmap22
tst_tmpdir.c:316: TINFO: Using /tmp/LTP_mmaLHJK4T as tmpdir (tmpfs filesystem)
tst_test.c:1941: TINFO: LTP version: 20250130-256-gb987b8ac5
tst_test.c:1945: TINFO: Tested kernel: 6.15.0-rc6-g627277ba7c23 #3 SMP PREEMPT_DYNAMIC Tue May 13 11:15:39 EDT 2025 x86_64
tst_kconfig.c:71: TINFO: Couldn't locate kernel config!
tst_test.c:1761: TINFO: Overall timeout per run is 0h 01m 00s
mmap22.c:59: TPASS: MAP_DROPPABLE test pass.

Summary:
passed   1
failed   0
broken   0
skipped  0
warnings 0



uname  -r
6.15.0-rc5
 ./mmap22
tst_tmpdir.c:316: TINFO: Using /tmp/LTP_mmauLlsmi as tmpdir (tmpfs filesystem)
tst_test.c:1941: TINFO: LTP version: 20250130-256-gb987b8ac5
tst_test.c:1945: TINFO: Tested kernel: 6.15.0-rc5 #4 SMP PREEMPT_DYNAMIC Tue May 13 11:38:14 EDT 2025 x86_64
tst_kconfig.c:71: TINFO: Couldn't locate kernel config!
tst_test.c:1761: TINFO: Overall timeout per run is 0h 01m 00s
mmap22.c:59: TPASS: MAP_DROPPABLE test pass.


> 
> 
> 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