>
That is clear. The issue would be to figure which chunks are valid to
unmap. If something critical like the executable file is unmapped,
the process crashes. But see below.
Ah, now I see what you mean. Yes, also the stack etc. will be
problematic. So IIUC, you want to limit the munmap optimization only to
the manually mmap()ed parts.
Is it fine to rely on CONFIG_ANON_VMA_NAME?
That would make it much easier to implement.
Can you elaborate how you would do it?
First set the VMA name after mmap():