qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: junqing.wang@cs2c.com.cn
To: quintela@redhat.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH RFC 3/4] Curling: the sender
Date: Wed, 11 Sep 2013 15:31:42 +0800 (CST)	[thread overview]
Message-ID: <6e382887.981e.1410beed24e.Coremail.junqing.wang@cs2c.com.cn> (raw)
In-Reply-To: <874n9sepqz.fsf@elfo.elfo>

[-- Attachment #1: Type: text/plain, Size: 2447 bytes --]

hi,


>> +    bool create = false;
> >This variable is never set.

It is set in the following 'if' block.
 +        create = true;    <<=======

>> -    migration_bitmap = bitmap_new(ram_pages);
>> -    bitmap_set(migration_bitmap, 0, ram_pages);
>> -    migration_dirty_pages = ram_pages;
>> +    if (!ft_enabled() || !migration_bitmap)  {
>> +        migration_bitmap = bitmap_new(ram_pages);
>> +        bitmap_set(migration_bitmap, 0, ram_pages);
>> +        migration_dirty_pages = ram_pages;
>> +        create = true;       <==========
>> +    }

>Nothing in this patch sets the migration_bitmap to anything.

Let me explain all the odd 'if'  block:
1 >> +    if (!ft_enabled() || !migration_bitmap)  {
2 >> +    if (!ft_enabled() || create) {
3 >> +    if (!ft_enabled()) {

As I mentioned in the commit log: 
>> We need to handle the variables related to live migration very
>> carefully. So the new migration does not restart from the very
>> begin of the migration, instead, it continues the previous
>> migration.

Some variables should not be reset after one migration, because
the next one need these variables to continue the migration.
This explains all the "if ft_enabled()"

Besides, some variables need to be initialized at the first migration of curling.
That explains the "if create" and "if  !migration_bitmap"

>> +                if (ft_enabled()) {
>> +                    if (old_vm_running) {
>> +                        qemu_mutex_lock_iothread();
>> +                        vm_start();
>> +                        qemu_mutex_unlock_iothread();
>> +
>> +                        current_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
>> +                        time_spent = current_time - migration_start_time;
>> +                        DPRINTF("this migration lasts for %" PRId64 "ms\n",
>> +                                time_spent);
>> +                        if (time_spent < time_window) {
>> +                            g_usleep((time_window - time_spent)*1000);
>
>Why are we waiting here?  If we are migration faster than allowed,  why
>we are waiting?

Looping fast is not good, that means we enter iothread lock and do vm stop more frequently. The performance will drop and vm user will experience input stall if we do not sleep.

How to deal with this is a difficult issue, any suggestion is welcomed.

THIS IS ONE OF THE TWO MAIN PROBLEMS.  The other one is related to the magic number 0xfeedcafe.



[-- Attachment #2: Type: text/html, Size: 5060 bytes --]

  reply	other threads:[~2013-09-11  7:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10  3:43 [Qemu-devel] [PATCH RFC 0/4] Curling: KVM Fault Tolerance Jules Wang
2013-09-10  3:43 ` [Qemu-devel] [PATCH RFC 1/4] Curling: add doc Jules Wang
2013-09-10  3:43 ` [Qemu-devel] [PATCH RFC 2/4] Curling: cmdline interface Jules Wang
2013-09-10 13:57   ` Juan Quintela
2013-09-10 13:03     ` Paolo Bonzini
2013-09-10 16:37       ` Juan Quintela
2013-09-10 14:38         ` Paolo Bonzini
2013-09-10 15:21           ` Juan Quintela
2013-09-10 15:22           ` Juan Quintela
2013-09-11  2:51     ` junqing.wang
2013-09-10  3:43 ` [Qemu-devel] [PATCH RFC 3/4] Curling: the sender Jules Wang
2013-09-10 14:05   ` Juan Quintela
2013-09-11  7:31     ` junqing.wang [this message]
2013-09-10  3:43 ` [Qemu-devel] [PATCH RFC 4/4] Curling: the receiver Jules Wang
2013-09-10 14:19   ` Juan Quintela
2013-09-11  8:25     ` junqing.wang
2013-09-10 12:27 ` [Qemu-devel] [PATCH RFC 0/4] Curling: KVM Fault Tolerance Orit Wasserman
2013-09-11  1:54   ` junqing.wang
2013-09-12  7:37     ` Orit Wasserman
2013-09-12  8:17       ` junqing.wang

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=6e382887.981e.1410beed24e.Coremail.junqing.wang@cs2c.com.cn \
    --to=junqing.wang@cs2c.com.cn \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).