qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 30/30] ram: optimize migration bitmap walking


From: Juan Quintela
Subject: Re: [Qemu-devel] [PATCH 30/30] ram: optimize migration bitmap walking
Date: Fri, 26 Oct 2012 13:39:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Orit Wasserman <address@hidden> wrote:
> On 10/18/2012 09:30 AM, Juan Quintela wrote:
>> Instead of testing each page individually, we search what is the next
>> dirty page with a bitmap operation.  We have to reorganize the code to
>> move from a "for" loop, to a while(dirty) loop.
>> 

>> 
>> -    do {
>> +    while(true) {
>>          mr = block->mr;
>> -        if (migration_bitmap_test_and_reset_dirty(mr, offset)) {
>> +        offset = migration_bitmap_find_and_reset_dirty(mr, offset);
>> +        if (complete_round && block == last_seen_block &&
>> +            offset >= last_offset) {
>> +            break;
>> +        }
> Juan,
> You need to exchange those line, first check to see you did a full round than
> calculate and reset the offset, in the way it is written now you may
> reset a bit and than break of the loop
> without sending it.

How?

if complete_round == true, it means that we are in the second round.

block == last_seen_block means that we are back at the 1st block that we
have looked.

if offset >= last_offset, there are two options:
a- == last_offset: that was the 1st one that we checked, so it can't be
   true.
b- >= last_offset: it means tat we have already passed that bit, it
   _has_ to be zero, otherwise somebody has changed the bitmap under or
   foot.

Or have I missed something?
Notice that at some point we should allow for concurrent dirty of the
bitmap, but we need to do yet more things.

Later, Juan.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]