From: Marcelo Tosatti <mtosatti@redhat.com>
To: Umesh Deshpande <udeshpan@redhat.com>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org,
Juan Quintela <quintela@redhat.com>
Subject: Re: [RFC PATCH v2 2/3] fine grained qemu_mutex locking for migration
Date: Tue, 2 Aug 2011 13:30:49 -0300 [thread overview]
Message-ID: <20110802163049.GB5144@amt.cnet> (raw)
In-Reply-To: <f4440591ca4843adff3a588864199ace81e5f11c.1311971938.git.udeshpan@redhat.com>
On Fri, Jul 29, 2011 at 04:57:25PM -0400, Umesh Deshpande wrote:
> In the migration thread, qemu_mutex is released during the most time consuming
> part. i.e. during is_dup_page which identifies the uniform data pages and during
> the put_buffer. qemu_mutex is also released while blocking on select to wait for
> the descriptor to become ready for writes.
>
> Signed-off-by: Umesh Deshpande <udeshpan@redhat.com>
> ---
> arch_init.c | 14 +++++++++++---
> migration.c | 11 +++++++----
> 2 files changed, 18 insertions(+), 7 deletions(-)
>
> diff --git a/arch_init.c b/arch_init.c
> index 484b39d..cd545bc 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -110,7 +110,7 @@ static int is_dup_page(uint8_t *page, uint8_t ch)
> static RAMBlock *last_block;
> static ram_addr_t last_offset;
>
> -static int ram_save_block(QEMUFile *f)
> +static int ram_save_block(QEMUFile *f, int stage)
> {
> RAMBlock *block = last_block;
> ram_addr_t offset = last_offset;
> @@ -131,6 +131,10 @@ static int ram_save_block(QEMUFile *f)
> current_addr + TARGET_PAGE_SIZE,
> MIGRATION_DIRTY_FLAG);
>
> + if (stage != 3) {
> + qemu_mutex_unlock_iothread();
> + }
> +
> p = block->host + offset;
>
> if (is_dup_page(p, *p)) {
> @@ -153,6 +157,10 @@ static int ram_save_block(QEMUFile *f)
> bytes_sent = TARGET_PAGE_SIZE;
> }
>
> + if (stage != 3) {
> + qemu_mutex_lock_iothread();
> + }
> +
Batching multiple pages (instead of a single page per lock/unlock cycle)
is probably worthwhile.
next prev parent reply other threads:[~2011-08-02 16:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-29 20:57 [RFC PATCH v2 0/3] separate thread for VM migration Umesh Deshpande
2011-07-29 20:57 ` [RFC PATCH v2 1/3] " Umesh Deshpande
2011-08-01 9:37 ` Paolo Bonzini
2011-08-01 21:00 ` Umesh Deshpande
2011-08-02 7:44 ` Paolo Bonzini
2011-07-29 20:57 ` [RFC PATCH v2 2/3] fine grained qemu_mutex locking for migration Umesh Deshpande
2011-08-01 9:39 ` Paolo Bonzini
2011-08-02 16:30 ` Marcelo Tosatti [this message]
2011-07-29 20:57 ` [RFC PATCH v2 3/3] Per memslot dirty bitmap Umesh Deshpande
2011-08-02 16:29 ` Marcelo Tosatti
2011-08-01 9:41 ` [RFC PATCH v2 0/3] separate thread for VM migration shawn che
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=20110802163049.GB5144@amt.cnet \
--to=mtosatti@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--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