[LTP] [PATCH] mmap22: Bound child memory allocation to avoid OOM

Attila Fazekas afazekas@redhat.com
Thu Nov 5 09:04:57 CET 2026


On Wed, Nov 4, 2026 at 5:41 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> > Assisted-by: Gemini CLI
> > Signed-off-by: Attila Fazekas <afazekas@redhat.com>
> > ---
> >  testcases/kernel/syscalls/mmap/mmap22.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/testcases/kernel/syscalls/mmap/mmap22.c
> b/testcases/kernel/syscalls/mmap/mmap22.c
> > index 0b95c578f..16fcb6dd8 100644
> > --- a/testcases/kernel/syscalls/mmap/mmap22.c
> > +++ b/testcases/kernel/syscalls/mmap/mmap22.c
> > @@ -26,6 +26,7 @@
> >
> >  #define MEM_LIMIT (256 * TST_MB)
> >  #define ALLOC_SIZE (128 * TST_MB)
> > +#define CHILD_ALLOC_MAX (ALLOC_SIZE + 32 * TST_MB)
>                              ^
>                              Wouldn't this be better:
>                              (MEM_LIMIT - ALLOC_SIZE + 32*TST_MB)
>
> This is better, I sent v2.
Thanks for the review.


> That way this would stil work if we change either MEM_LIMIT or
> ALLOC_SIZE.
>
> Otherwise the change looks good.
>
> --
> Cyril Hrubis
> chrubis@suse.cz
>
>


More information about the ltp mailing list