All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Umesh Deshpande <udeshpan@redhat.com>,
	kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 1/5] Support for vm_stop from the migration thread
Date: Tue, 30 Aug 2011 10:40:41 +0200	[thread overview]
Message-ID: <4E5CA209.7080506@redhat.com> (raw)
In-Reply-To: <20110829165624.GA3003@amt.cnet>

On 08/29/2011 06:56 PM, Marcelo Tosatti wrote:
>> >  diff --git a/cpus.c b/cpus.c
>> >  index de70e02..f35f683 100644
>> >  --- a/cpus.c
>> >  +++ b/cpus.c
>> >  @@ -122,8 +122,8 @@ static void do_vm_stop(int reason)
>> >    {
>> >        if (vm_running) {
>> >            cpu_disable_ticks();
>> >  -        vm_running = 0;
>> >            pause_all_vcpus();
>> >  +        vm_running = 0;
>> >            vm_state_notify(0, reason);
>> >            qemu_aio_flush();
>> >            bdrv_flush_all();
> Why this change?

Without it, you could have two threads calling into do_vm_stop and the 
second would not wait for all CPUs to be paused.  Still not perfect as 
you'd get double notifications, you would need a condition variable or 
QemuEvent (from the RCU series) for that.

Paolo

WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Umesh Deshpande <udeshpan@redhat.com>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH 1/5] Support for vm_stop from the migration thread
Date: Tue, 30 Aug 2011 10:40:41 +0200	[thread overview]
Message-ID: <4E5CA209.7080506@redhat.com> (raw)
In-Reply-To: <20110829165624.GA3003@amt.cnet>

On 08/29/2011 06:56 PM, Marcelo Tosatti wrote:
>> >  diff --git a/cpus.c b/cpus.c
>> >  index de70e02..f35f683 100644
>> >  --- a/cpus.c
>> >  +++ b/cpus.c
>> >  @@ -122,8 +122,8 @@ static void do_vm_stop(int reason)
>> >    {
>> >        if (vm_running) {
>> >            cpu_disable_ticks();
>> >  -        vm_running = 0;
>> >            pause_all_vcpus();
>> >  +        vm_running = 0;
>> >            vm_state_notify(0, reason);
>> >            qemu_aio_flush();
>> >            bdrv_flush_all();
> Why this change?

Without it, you could have two threads calling into do_vm_stop and the 
second would not wait for all CPUs to be paused.  Still not perfect as 
you'd get double notifications, you would need a condition variable or 
QemuEvent (from the RCU series) for that.

Paolo

  reply	other threads:[~2011-08-30  8:40 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-27 18:09 [PATCH 0/5] Separate thread for VM migration Umesh Deshpande
2011-08-27 18:09 ` [Qemu-devel] " Umesh Deshpande
2011-08-27 18:09 ` [PATCH 1/5] Support for vm_stop from the migration thread Umesh Deshpande
2011-08-27 18:09   ` [Qemu-devel] " Umesh Deshpande
2011-08-29 16:56   ` Marcelo Tosatti
2011-08-29 16:56     ` [Qemu-devel] " Marcelo Tosatti
2011-08-30  8:40     ` Paolo Bonzini [this message]
2011-08-30  8:40       ` Paolo Bonzini
2011-08-27 18:09 ` [PATCH 2/5] MRU ram block list Umesh Deshpande
2011-08-27 18:09   ` [Qemu-devel] " Umesh Deshpande
2011-08-27 18:09 ` [PATCH 3/5] Migration thread mutex Umesh Deshpande
2011-08-27 18:09   ` [Qemu-devel] " Umesh Deshpande
2011-08-29  9:04   ` Stefan Hajnoczi
2011-08-29  9:04     ` [Qemu-devel] " Stefan Hajnoczi
2011-08-29 13:49     ` Umesh Deshpande
2011-08-29 13:49       ` [Qemu-devel] " Umesh Deshpande
2011-08-29 18:40   ` Marcelo Tosatti
2011-08-29 18:40     ` [Qemu-devel] " Marcelo Tosatti
2011-08-27 18:09 ` [PATCH 4/5] Separate migration dirty bitmap Umesh Deshpande
2011-08-27 18:09   ` [Qemu-devel] " Umesh Deshpande
2011-08-27 18:09 ` [PATCH 5/5] Separate migration thread Umesh Deshpande
2011-08-27 18:09   ` [Qemu-devel] " Umesh Deshpande
2011-08-29  9:09   ` Stefan Hajnoczi
2011-08-29  9:09     ` [Qemu-devel] " Stefan Hajnoczi
2011-08-29 13:49     ` Umesh Deshpande
2011-08-29 13:49       ` [Qemu-devel] " Umesh Deshpande
2011-08-29 18:49   ` Marcelo Tosatti
2011-08-29 18:49     ` [Qemu-devel] " Marcelo Tosatti
2011-08-30  8:48     ` Paolo Bonzini
2011-08-30  8:48       ` [Qemu-devel] " Paolo Bonzini
2011-08-30 12:31       ` Marcelo Tosatti
2011-08-30 12:31         ` [Qemu-devel] " Marcelo Tosatti
2011-08-29 10:20 ` [PATCH 0/5] Separate thread for VM migration Paolo Bonzini
2011-08-29 10:20   ` [Qemu-devel] " Paolo Bonzini
2011-08-31  3:53   ` Umesh Deshpande
2011-08-31  3:53     ` [Qemu-devel] " Umesh Deshpande

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=4E5CA209.7080506@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=udeshpan@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 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.