Conversation

An mremap call fails if the source has multiple VMAs and the kernel often fails to do VMA merging when it should. It also has no way to preserve the source mapping when moving. I can't use it to move anything below the quarantine threshold. In jemalloc, they can't use it at all.
1
If it could move multiple VMAs and expand the last one, it would also avoid needing this in-place growth path in the first place. There could be a single code path for expansion and the moving case would be far simpler instead of a convoluted mess working around this bad API.
1
1
In-place growth rarely succeeds due to mmap best-fit, typical 2x growth factor for contiguous collections (arrays / ringbufs, hash tables) and downwards mmap growth. Causing split VMAs leading to the important mremap failing makes disabling this an easy choice. Not a big loss.