On 03/11/2010 06:05 PM, Andrea Arcangeli wrote:
On Thu, Mar 11, 2010 at 05:52:16PM +0200, Avi Kivity wrote:
That is a little wasteful. How about a hint to mmap() requesting proper
alignment (MAP_HPAGE_ALIGN)?
So you suggest adding a new kernel feature to mmap? Not sure if it's
worth it, considering it'd also increase the number of vmas because it
will have to leave an hole. Wasting 2M-4k of virtual memory is likely
cheaper than having 1 more vma in the rbtree for every page fault. So
I think it's better to just malloc and adjust ourselfs on the next
offset which is done in userland by qemu_memalign I think.
Won't we get a new vma anyway due to the madvise() call later?
But I agree it isn't worth it.
--
Do not meddle in the internals of kernels, for they are subtle and quick to
panic.