qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Chegu Vinod <chegu_vinod@hp.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: quintela@redhat.com, qemu-devel@nongnu.org, owasserm@redhat.com,
	anthony@codemonkey.ws, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH v5 3/3] Force auto-convegence of live migration
Date: Thu, 09 May 2013 16:00:38 -0700	[thread overview]
Message-ID: <518C2A96.7010508@hp.com> (raw)
In-Reply-To: <20130509222439.0e1c5041@thinkpad>

On 5/9/2013 1:24 PM, Igor Mammedov wrote:
> On Thu,  9 May 2013 12:43:20 -0700
> Chegu Vinod <chegu_vinod@hp.com> wrote:
>
>>   If a user chooses to turn on the auto-converge migration capability
>>   these changes detect the lack of convergence and throttle down the
>>   guest. i.e. force the VCPUs out of the guest for some duration
>>   and let the migration thread catchup and help converge.
>>
> [...]
>> +
>> +static void mig_delay_vcpu(void)
>> +{
>> +    qemu_mutex_unlock_iothread();
>> +    g_usleep(50*1000);
>> +    qemu_mutex_lock_iothread();
>> +}
>> +
>> +/* Stub used for getting the vcpu out of VM and into qemu via
>> +   run_on_cpu()*/
>> +static void mig_kick_cpu(void *opq)
>> +{
>> +    mig_delay_vcpu();
>> +    return;
>> +}
>> +
>> +/* To reduce the dirty rate explicitly disallow the VCPUs from spending
>> +   much time in the VM. The migration thread will try to catchup.
>> +   Workload will experience a performance drop.
>> +*/
>> +void migration_throttle_down(void)
>> +{
>> +    if (throttling_needed()) {
>> +        CPUArchState *penv = first_cpu;
>> +        while (penv) {
>> +            qemu_mutex_lock_iothread();
> Locking it here and the unlocking it inside of queued work doesn't look nice.
Yes...but see below.
> What exactly are you protecting with this lock?
It was my understanding that BQL is supposed to be held when the vcpu 
threads start entering and executing in the qemu context (as qemu is not 
MP safe).. Still true?

In this specific use case I was concerned about the fraction of the time 
when a given vcpu thread is in the qemu context but not executing the 
callback routine...and was hence holding the BQL.Holding the BQL and 
g_usleep'ng is not only bad but would slow down the migration 
thread...hence the "doesn't look nice" stuff :(

For this specific use case If its not really required to even bother 
with the BQL then pl. do let me know.

Also pl. refer to version 3 of my patch....I was doing a g_usleep() in 
kvm_cpu_exec() and was not messing much with the BQL....but that was 
deemed as not a good thing either.

Thanks
Vinod

>
>> +            async_run_on_cpu(ENV_GET_CPU(penv), mig_kick_cpu, NULL);
>> +            qemu_mutex_unlock_iothread();
>> +            penv = penv->next_cpu;
>> +        }
>> +    }
>> +}
>
>

  reply	other threads:[~2013-05-09 23:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-09 19:43 [Qemu-devel] [RFC PATCH v5 0/3] Throttle-down guest to help with live migration convergence Chegu Vinod
2013-05-09 19:43 ` [Qemu-devel] [RFC PATCH v5 1/3] Introduce async_run_on_cpu() Chegu Vinod
2013-05-10  7:43   ` Paolo Bonzini
2013-05-09 19:43 ` [Qemu-devel] [RFC PATCH v5 2/3] Add 'auto-converge' migration capability Chegu Vinod
2013-05-10  7:43   ` Paolo Bonzini
2013-05-10 14:26     ` Eric Blake
2013-05-09 19:43 ` [Qemu-devel] [RFC PATCH v5 3/3] Force auto-convegence of live migration Chegu Vinod
2013-05-09 20:05   ` Igor Mammedov
2013-05-09 22:26     ` Chegu Vinod
2013-05-09 20:24   ` Igor Mammedov
2013-05-09 23:00     ` Chegu Vinod [this message]
2013-05-10  7:47       ` Paolo Bonzini
2013-05-10  7:41   ` Paolo Bonzini
2013-05-10 13:07   ` Anthony Liguori
2013-05-10 14:14     ` Chegu Vinod
2013-05-10 15:11       ` Anthony Liguori
2013-05-12 17:19         ` Paolo Bonzini
2013-05-13 12:18           ` Anthony Liguori
2013-05-10 14:17     ` Daniel P. Berrange
2013-05-10 15:08       ` Anthony Liguori
2013-05-13 12:33         ` Daniel P. Berrange

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=518C2A96.7010508@hp.com \
    --to=chegu_vinod@hp.com \
    --cc=anthony@codemonkey.ws \
    --cc=imammedo@redhat.com \
    --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).