public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, Umesh Deshpande <udeshpan@redhat.com>,
	quintela@redhat.com
Subject: Re: [RFC PATCH v3 3/4] lock to protect memslots
Date: Mon, 15 Aug 2011 00:26:48 -0700	[thread overview]
Message-ID: <20110815072648.GA2916@amt.cnet> (raw)
In-Reply-To: <4E44CC1E.202@redhat.com>

On Fri, Aug 12, 2011 at 08:45:50AM +0200, Paolo Bonzini wrote:
> On 08/11/2011 06:20 PM, Paolo Bonzini wrote:
> >>
> >>+                qemu_mutex_lock_ramlist();
> >>                  QLIST_REMOVE(block, next);
> >>                  QLIST_INSERT_HEAD(&ram_list.blocks, block, next);
> >>+                qemu_mutex_unlock_ramlist();
> >
> >Theoretically qemu_get_ram_ptr should be protected.  The problem is not
> >just accessing the ramlist, it is accessing the data underneath it
> >before anyone frees it.  Luckily we can set aside that problem for now,
> >because qemu_ram_free_from_ptr is only used by device assignment and
> >device assignment makes VMs unmigratable.
> 
> Hmm, rethinking about it, all the loops in exec.c should be
> protected from the mutex.  That's not too good because
> qemu_get_ram_ptr is a hot path for TCG.

Right.

>  Perhaps you can also avoid
> the mutex entirely, and just disable the above optimization for
> most-recently-used-block while migration is running.  It's not a
> complete solution, but it could be good enough until we have RAM
> hot-plug/hot-unplug.

Actually the previous patchset does not traverse the ramlist without 
qemu_mutex locked, which is safe versus the most-recently-used-block
optimization.

So, agreed that the new ramlist lock is not necessary for now. 


  parent reply	other threads:[~2011-08-15  7:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 15:32 [RFC PATCH v3 0/4] Separate thread for VM migration Umesh Deshpande
2011-08-11 15:32 ` [RFC PATCH v3 1/4] separate " Umesh Deshpande
2011-08-11 16:18   ` Paolo Bonzini
2011-08-11 17:36     ` Umesh Deshpande
2011-08-12  6:40       ` Paolo Bonzini
2011-08-11 15:32 ` [RFC PATCH v3 2/4] Making iothread block for migrate_cancel Umesh Deshpande
2011-08-11 15:32 ` [RFC PATCH v3 3/4] lock to protect memslots Umesh Deshpande
2011-08-11 16:20   ` Paolo Bonzini
2011-08-12  6:45     ` Paolo Bonzini
2011-08-15  6:45       ` Umesh Deshpande
2011-08-15 14:10         ` Paolo Bonzini
2011-08-15  7:26       ` Marcelo Tosatti [this message]
2011-08-15 14:14         ` Paolo Bonzini
2011-08-15 20:27           ` Umesh Deshpande
2011-08-16  6:15             ` Paolo Bonzini
2011-08-16  7:56               ` Paolo Bonzini
2011-08-11 15:32 ` [RFC PATCH v3 4/4] Separate migration bitmap Umesh Deshpande
2011-08-11 16:23 ` [RFC PATCH v3 0/4] Separate thread for VM migration Paolo Bonzini
2011-08-11 18:25 ` Anthony Liguori

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=20110815072648.GA2916@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --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