public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Umesh Deshpande <umesh_d@live.com>
Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 0/5] Separate thread for VM migration
Date: Mon, 29 Aug 2011 12:20:46 +0200	[thread overview]
Message-ID: <4E5B67FE.4020209@redhat.com> (raw)
In-Reply-To: <cover.1314398066.git.udeshpan@redhat.com>

On 08/27/2011 08:09 PM, Umesh Deshpande wrote:
> Following patch series deals with VCPU and iothread starvation during the
> migration of a guest. Currently the iothread is responsible for performing the
> guest migration. It holds 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 series,
>
> The migration has been moved to a separate thread to
> reduce the qemu_mutex contention and iohandler starvation.
>
> Umesh Deshpande (5):
>    vm_stop from non-io threads
>    MRU ram block list
>    migration thread mutex
>    separate migration bitmap
>    separate migration thread
>
>   arch_init.c         |   38 +++++++++++++----
>   buffered_file.c     |   76 ++++++++++++++++++---------------
>   cpu-all.h           |   42 ++++++++++++++++++
>   cpus.c              |    4 +-
>   exec.c              |   97 ++++++++++++++++++++++++++++++++++++++++--
>   migration.c         |  117 ++++++++++++++++++++++++++++++++-------------------
>   migration.h         |    9 ++++
>   qemu-common.h       |    2 +
>   qemu-thread-posix.c |   10 ++++
>   qemu-thread.h       |    1 +
>   10 files changed, 302 insertions(+), 94 deletions(-)
>

I think this patchset is quite good.  These are the problems I found:

1) the locking rules in patch 3 are a bit too clever, and the cleverness 
will become obsolete once RCU is in place.  The advantage of the clever 
stuff is that rwlock code looks more like RCU code; the disadvantage is 
that it is harder to read and easier to bikeshed about.

2) it breaks Windows build, but that's easy to fix.

3) there are a _lot_ of cleanups possible on top of patch 5 (I would not 
be too surprised if the final version has an almost-neutral diffstat), 
and whether to prefer good or perfect is another very popular topic.

4) I'm not sure block migration has been tested in all scenarios (I'm 
curious about coroutine-heavy ones).  This may mean that the migration 
thread is blocked onto Marcelo's live streaming work, which would 
provide the ingredients to remove block migration altogether.  A round 
of Autotest testing is the minimum required to include this, and I'm not 
sure if this was done either.


That said, I find the code to be quite good overall, and I wouldn't 
oppose inclusion with only (2) fixed---may even take care of it 
myself---and more testing results apart from the impressive performance 
numbers.

About performance, I'm curious how you measured it.  Was the buffer 
cache empty?  That is, how many compressible pages were found?  I toyed 
with vectorizing is_dup_page, but I need to get some numbers before posting.

Paolo

  parent reply	other threads:[~2011-08-29 10:20 UTC|newest]

Thread overview: 18+ 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 ` [PATCH 1/5] Support for vm_stop from the migration thread Umesh Deshpande
2011-08-29 16:56   ` Marcelo Tosatti
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 ` [PATCH 3/5] Migration thread mutex Umesh Deshpande
2011-08-29  9:04   ` Stefan Hajnoczi
2011-08-29 13:49     ` Umesh Deshpande
2011-08-29 18:40   ` Marcelo Tosatti
2011-08-27 18:09 ` [PATCH 4/5] Separate migration dirty bitmap Umesh Deshpande
2011-08-27 18:09 ` [PATCH 5/5] Separate migration thread Umesh Deshpande
2011-08-29  9:09   ` Stefan Hajnoczi
2011-08-29 13:49     ` Umesh Deshpande
2011-08-29 18:49   ` Marcelo Tosatti
2011-08-30  8:48     ` Paolo Bonzini
2011-08-30 12:31       ` Marcelo Tosatti
2011-08-29 10:20 ` Paolo Bonzini [this message]
2011-08-31  3:53   ` [PATCH 0/5] Separate thread for VM migration 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=4E5B67FE.4020209@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=umesh_d@live.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