/ go Public
runtime: use mremap to move "big" stacks when growing on linux #52910
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
mremapallows to move a part of the virtual address space while leaving the physical one unchanged, it also allows growing the moved space with a zero fill.
This is a perfect candidate for resizing big stacks, as this is essentially an ~O(1) operation (it's O(N) on the number of pages, but this cost is minimal and this is heavly dominated by the kernel entry overhead).
This could even maybe allows us to skip taking a few locks because we wouldn't have to interact with the shared memory pool (altho maybe still to keep the address space coherent ?).
This would be a non portable optimization as this syscall is linux specific.
The text was updated successfully, but these errors were encountered: