Message ID | 20180110142515.13242-3-pbonzini@redhat.com |
---|---|
State | New |
Headers | show |
Series | find_ram_offset cleanups and alignment | expand |
diff --git a/exec.c b/exec.c index 829f9d8d1a..c543b54094 100644 --- a/exec.c +++ b/exec.c @@ -1679,7 +1679,11 @@ static ram_addr_t find_ram_offset(ram_addr_t size) RAMBLOCK_FOREACH(block) { ram_addr_t candidate, next = RAM_ADDR_MAX; + /* Align blocks to start on a 'long' in the bitmap + * which makes the bitmap sync'ing take the fast path. + */ candidate = block->offset + block->max_length; + candidate = ROUND_UP(candidate, BITS_PER_LONG << TARGET_PAGE_BITS); /* Search for the closest following block * and find the gap.