[LTP] [PATCH] mmap_24-1: Change vm.max_map_count if needed

Petr Vorel pvorel@suse.cz
Fri May 9 12:52:59 CEST 2025


> On 07. 05. 25 19:53, Petr Vorel wrote:
> > Hi Martin,

> > > If vm.max_map_count system parameter is too high, mmap24-1 may get
> > > killed by OOM. Set the parameter to a reasonable low value so that
> > > mmap() quickly fails as expected.

> > LGTM.
> > Reviewed-by: Petr Vorel <pvorel@suse.cz>

> > The only thing which bothers me is that writing /proc/sys/vm/max_map_count
> > requires root. But I'm not sure if it's worth to add more code to check UID 0.

> We don't need a check, the test will simply fail to open the file and move
> on to the main test case. But I'll add an info message if that happens.

Testing without root with too high /proc/sys/vm/max_map_count will fail due not
able to lower down it. But sure, explaining message is IMHO good enough, thanks!

Kind regards,
Petr


More information about the ltp mailing list