From: Anthony Liguori <anthony@codemonkey.ws>
To: Avi Kivity <avi@redhat.com>
Cc: Umesh Deshpande <udeshpan@redhat.com>,
qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [RFC] New thread for the VM migration
Date: Thu, 14 Jul 2011 07:30:59 -0500 [thread overview]
Message-ID: <4E1EE183.5050100@codemonkey.ws> (raw)
In-Reply-To: <4E1EAA72.1060103@redhat.com>
On 07/14/2011 03:36 AM, Avi Kivity wrote:
> On 07/14/2011 10:14 AM, Umesh Deshpande wrote:
>> Following patch is implemented to deal with the VCPU and iothread
>> starvation during the migration of a guest. Currently iothread is
>> responsible for performing the migration. It holds the qemu_mutex
>> during the migration and doesn't allow VCPU to enter the qemu mode and
>> delays its return to the guest. The guest migration, executed as an
>> iohandler also delays the execution of other iohandlers. In the
>> following patch, the migration has been moved to a separate thread to
>> reduce the qemu_mutex contention and iohandler starvation.
>>
>>
>> @@ -260,10 +260,15 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int
>> stage, void *opaque)
>> return 0;
>> }
>>
>> + if (stage != 3)
>> + qemu_mutex_lock_iothread();
>
> Please read CODING_STYLE, especially the bit about braces.
>
> Does this mean that the following code is sometimes executed without
> qemu_mutex? I don't think any of it is thread safe.
That was my reaction too.
I think the most rational thing to do is have a separate thread and a
pair of producer/consumer queues.
The I/O thread can push virtual addresses and sizes to the queue for the
migration thread to compress/write() to the fd. The migration thread
can then push sent regions onto a separate queue for the I/O thread to
mark as dirty.
Regards,
Anthony Liguori
>
> Even just reading memory is not thread safe. You either have to copy it
> into a buffer under lock, or convert the memory API to RCU.
>
next prev parent reply other threads:[~2011-07-14 12:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <539565793.1312156.1310595395982.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com>
2011-07-13 23:34 ` [Qemu-devel] [RFC] New thread for the VM migration Umesh Deshpande
2011-07-14 7:14 ` Umesh Deshpande
2011-07-14 8:36 ` Avi Kivity
2011-07-14 9:09 ` Stefan Hajnoczi
2011-07-14 12:30 ` Anthony Liguori [this message]
2011-07-14 12:32 ` Avi Kivity
2011-07-14 15:30 ` Juan Quintela
2011-07-14 15:44 ` Avi Kivity
2011-07-14 15:52 ` Juan Quintela
2011-07-14 16:07 ` Avi Kivity
2011-07-15 7:59 ` Paolo Bonzini
2011-07-15 21:09 ` Anthony Liguori
2011-07-17 8:39 ` Avi Kivity
2011-07-18 7:08 ` Markus Armbruster
2011-07-14 16:49 ` Anthony Liguori
2011-07-14 16:59 ` Avi Kivity
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=4E1EE183.5050100@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--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 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).