eve
eve copied to clipboard
xen-tools: Revamp mmap allocation in QEMU
Change the algorithm of mmap-based memory allocation to reduce the amount of PTE changes
Signed-off-by: Sergey Temerkhanov [email protected]
Instead of calling mmap() twice, we do mmap(...PROT_READ|PROT_WRITE...) + mprotect(PROT_NONE) to get the guard pages
Right @temerkhanov -- I get this -- but what's the benefit of this way of doing things?
Instead of calling mmap() twice, we do mmap(...PROT_READ|PROT_WRITE...) + mprotect(PROT_NONE) to get the guard pages
Right @temerkhanov -- I get this -- but what's the benefit of this way of doing things?
At least it reduces amount of noise in memory profilers, and, apparently, the VSZ
The patch calls mprotect() on a memory region instead of a second mmap(), expecting, that this will reduce amount of PTE changes, which is not the case: mprotect splits VMA and updates PTE range, so performance benefits are not clear. @eriknordmark let's close this.
Closing based on the comment from @rouming above.