On 01/14/2010 04:38 PM, Richard Henderson wrote:
Previously, mmap_find_vma could return addresses not properly aligned
to the target page size.  This of course led to all sorts of odd
problems down the road.

The trivial fix, to simply reject the unaligned address and continue
searching the address space by increments of one page, is not a good
idea when there's a 64-bit address space involved.  The kernel may well
continue to return the last available address which we've already
rejected while we search upward from e.g. 2**42 from 2**64.

This patch uses a more complex search algorithm that takes the result
of the previous allocation into account.  We normally search upward,
but notice 2 consecutive results and start searching downward instead.

I've failed to take guest_base into account properly; my testing happened to have guest_base = 0. New patch to follow.


r~


Reply via email to