On 09.01.25 14:05, David Hildenbrand wrote:
>
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():
I took a look at the implementation, and VMA merging seems to be able to
merge such VMAs that share the same name (even when set separately).
So assuming you use the same name for all, that should indeed also work.
--
Cheers,
David / dhildenb