Increasing the vm.max_map_count value

From: Alessandro Astone
Date: Tue May 23 2023 - 10:16:13 EST


We are seeing userspace requiring more than the default 65330 mappings,
specifically some Windows games running through wine. We are looking into
changing the default in Fedora, but the source code includes a scary comment
about the current value:

> Default maximum number of active map areas, this limits the number of vmas
> per mm struct. Users can overwrite this number by sysctl but there is a
> problem.
>
> When a program's coredump is generated as ELF format, a section is created
> per a vma. In ELF, the number of sections is represented in unsigned short.
> This means the number of sections should be smaller than 65535 at coredump.
> Because the kernel adds some informative sections to a image of program at
> generating coredump, we need some margin. The number of extra sections is
> 1-3 now and depends on arch. We use "5" as safe margin, here.

It seems that going over 16 bits would at least break ELF coredumps (for
programs actually requesting as many mappings).

Do you think it is otherwise safe to increase this value arbitrarily?