qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Chegu Vinod <chegu_vinod@hp.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: owasserm@redhat.com, qemu-devel@nongnu.org,
	anthony@codemonkey.ws, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH v7 3/3] Force auto-convegence of live migration
Date: Mon, 24 Jun 2013 06:08:53 -0700	[thread overview]
Message-ID: <51C844E5.9010705@hp.com> (raw)
In-Reply-To: <51C84332.5020603@redhat.com>

On 6/24/2013 6:01 AM, Paolo Bonzini wrote:
> One nit and one question:
>
> Il 23/06/2013 22:11, Chegu Vinod ha scritto:
>> @@ -404,6 +413,23 @@ static void migration_bitmap_sync(void)
>>   
>>       /* more than 1 second = 1000 millisecons */
>>       if (end_time > start_time + 1000) {
>> +        if (migrate_auto_converge()) {
>> +            /* The following detection logic can be refined later. For now:
>> +               Check to see if the dirtied bytes is 50% more than the approx.
>> +               amount of bytes that just got transferred since the last time we
>> +               were in this routine. If that happens >N times (for now N==4)
>> +               we turn on the throttle down logic */
>> +            bytes_xfer_now = ram_bytes_transferred();
>> +            if (s->dirty_pages_rate &&
>> +               (num_dirty_pages_period * TARGET_PAGE_SIZE >
>> +                   (bytes_xfer_now - bytes_xfer_prev)/2) &&
>> +               (dirty_rate_high_cnt++ > 4)) {
>> +                    trace_migration_throttle();
>> +                    mig_throttle_on = true;
>> +                    dirty_rate_high_cnt = 0;
>> +             }
>> +             bytes_xfer_prev = bytes_xfer_now;
>> +        }
>
> Missing:
>
>   else {
>       mig_throttle_on = false;
>   }

Ok.
>> +/* Stub function that's gets run on the vcpu when its brought out of the
>> +   VM to run inside qemu via async_run_on_cpu()*/
>> +static void mig_sleep_cpu(void *opq)
>> +{
>> +    qemu_mutex_unlock_iothread();
>> +    g_usleep(30*1000);
>> +    qemu_mutex_lock_iothread();
>> +}
>> +
>> +    /* If it has been more than 40 ms since the last time the guest
>> +     * was throttled then do it again.
>> +     */
>> +    if (40 < (t1-t0)/1000000) {
> You're stealing 75% of the CPU time, isn't that a lot?

Depends on the dirty rate vs. transfer rate... I had tried 50% too and 
it took much longer for the migration to converge.

Vinod

>
>> +        mig_throttle_guest_down();
>> +        t0 = t1;
>> +    }
>> +}
>>
> Paolo
>
> .
>

  reply	other threads:[~2013-06-24 13:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-23 20:11 [Qemu-devel] [PATCH v7 3/3] Force auto-convegence of live migration Chegu Vinod
2013-06-24 13:01 ` Paolo Bonzini
2013-06-24 13:08   ` Chegu Vinod [this message]
2013-06-24 13:42     ` Paolo Bonzini

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=51C844E5.9010705@hp.com \
    --to=chegu_vinod@hp.com \
    --cc=anthony@codemonkey.ws \
    --cc=owasserm@redhat.com \
    --cc=pbonzini@redhat.com \
    --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).