All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Hailiang Zhang <zhang.zhanghailiang@huawei.com>
Cc: qemu-devel@nongnu.org, dgilbert@redhat.com
Subject: Re: [Qemu-devel] [PATCH] ram: Split dirty bitmap by RAMBlock
Date: Tue, 25 Apr 2017 15:00:42 +0200	[thread overview]
Message-ID: <87r30gmykl.fsf@secure.mitica> (raw)
In-Reply-To: <58FF38DE.4010902@huawei.com> (Hailiang Zhang's message of "Tue, 25 Apr 2017 19:54:06 +0800")

Hailiang Zhang <zhang.zhanghailiang@huawei.com> wrote:
> On 2017/4/25 18:11, Juan Quintela wrote:
>> Both the ram bitmap and the unsent bitmap are split by RAMBlock.
>>
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> ---
>>   include/exec/ram_addr.h          |  13 +-
>>   include/migration/postcopy-ram.h |   3 -
>>   migration/postcopy-ram.c         |   5 +-
>>   migration/ram.c                  | 257 +++++++++++++++------------------------
>>   4 files changed, 109 insertions(+), 169 deletions(-)
>>

>> +
>> +    QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
> ... ...
>> +        unsigned long pages = block->used_length >> TARGET_PAGE_BITS;
>> +        unsigned long *bitmap = block->bmap;
>> +        unsigned long *unsentmap = block->unsentmap;
>> +
>> +        if (!unsentmap) {
>> +            /* We don't have a safe way to resize the sentmap, so
>> +             * if the bitmap was resized it will be NULL at this
>> +             * point.
>> +             */
>> +            error_report("migration ram resized during precopy phase");
>> +            rcu_read_unlock();
>> +            return -EINVAL;
>> +        }
>> +        /* Deal with TPS != HPS and huge pages */
>> +        ret = postcopy_chunk_hostpages(ms, block);
>> +        if (ret) {
>> +            rcu_read_unlock();
>> +            return ret;
>> +        }
>> +
>> +        /*
>> +         * Update the unsentmap to be unsentmap = unsentmap | dirty
>>            */
>> -        error_report("migration ram resized during precopy phase");
>> -        rcu_read_unlock();
>> -        return -EINVAL;
>> +        bitmap_or(unsentmap, unsentmap, bitmap, pages);
>>       }
>> -
>> -    /* Deal with TPS != HPS and huge pages */
>> -    ret = postcopy_chunk_hostpages(ms);
>> -    if (ret) {
>> -        rcu_read_unlock();
>> -        return ret;
>> -    }
>> -
>> -    /*
>> -     * Update the unsentmap to be unsentmap = unsentmap | dirty
>> -     */
>> -    bitmap = atomic_rcu_read(&rs->ram_bitmap)->bmap;
>> -    bitmap_or(unsentmap, unsentmap, bitmap, last_ram_page());
>> -
>> -
>>       trace_ram_postcopy_send_discard_bitmap();
>>   #ifdef DEBUG_POSTCOPY
>>       ram_debug_dump_bitmap(unsentmap, true);
>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> It seems that, you forgot to put the above codes in the loop:
>
>   QLIST_FOREACH_RCU(block, &ram_list.blocks, next)
>
> If DEBUG_POSTCOPY is defined, compiling will fail ...

Fixed, thanks.

Now I put that code inside the FOREACH with the "pages" parameter.

Later, Juan.

  reply	other threads:[~2017-04-25 13:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25 10:11 [Qemu-devel] [PATCH v4] Split migration bitmaps by ramblock Juan Quintela
2017-04-25 10:11 ` [Qemu-devel] [PATCH] ram: Split dirty bitmap by RAMBlock Juan Quintela
2017-04-25 11:54   ` Hailiang Zhang
2017-04-25 13:00     ` Juan Quintela [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-04-26  7:32 [Qemu-devel] [PATCH v5] Split migration bitmaps by ramblock Juan Quintela
2017-04-26  7:32 ` [Qemu-devel] [PATCH] ram: Split dirty bitmap by RAMBlock Juan Quintela
2017-04-26  8:54   ` Hailiang Zhang
2017-04-26 10:53     ` Juan Quintela
2017-04-26  9:16   ` Peter Xu
2017-04-26 10:57   ` no-reply
2017-04-19 21:06 [Qemu-devel] [PATCH v3] Split migration bitmaps by ramblock Juan Quintela
2017-04-19 21:06 ` [Qemu-devel] [PATCH] ram: Split dirty bitmap by RAMBlock Juan Quintela
2017-04-20 12:36   ` Dr. David Alan Gilbert
2017-03-23 21:01 [Qemu-devel] [RFC] Split migration bitmaps by ramblock Juan Quintela
2017-03-23 21:01 ` [Qemu-devel] [PATCH] ram: Split dirty bitmap by RAMBlock Juan Quintela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r30gmykl.fsf@secure.mitica \
    --to=quintela@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.