From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [RFC PATCH v4 2/5] ramlist mutex Date: Tue, 23 Aug 2011 06:17:26 -0300 Message-ID: <20110823091726.GA5797@amt.cnet> References: <8f99d56f3a48b6255cf70425bc435d8f231f5352.1313552764.git.udeshpan@redhat.com> <20110823091533.GA5207@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, quintela@redhat.com To: Umesh Deshpande Return-path: Content-Disposition: inline In-Reply-To: <20110823091533.GA5207@amt.cnet> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org On Tue, Aug 23, 2011 at 06:15:33AM -0300, Marcelo Tosatti wrote: > On Tue, Aug 16, 2011 at 11:56:37PM -0400, Umesh Deshpande wrote: > > ramlist mutex is implemented to protect the RAMBlock list traversal in the > > migration thread from their addition/removal from the iothread. > > > > Signed-off-by: Umesh Deshpande > > --- > > cpu-all.h | 2 ++ > > exec.c | 19 +++++++++++++++++++ > > qemu-common.h | 2 ++ > > 3 files changed, 23 insertions(+), 0 deletions(-) > > > > diff --git a/cpu-all.h b/cpu-all.h > > index 6b217a2..eab9803 100644 > > --- a/cpu-all.h > > +++ b/cpu-all.h > > @@ -21,6 +21,7 @@ > > > > #include "qemu-common.h" > > #include "cpu-common.h" > > +#include "qemu-thread.h" > > > > /* some important defines: > > * > > @@ -932,6 +933,7 @@ typedef struct RAMBlock { > > } RAMBlock; > > > > typedef struct RAMList { > > + QemuMutex mutex; > > uint8_t *phys_dirty; > > QLIST_HEAD(ram, RAMBlock) blocks; > > QLIST_HEAD(, RAMBlock) blocks_mru; > > A comment on what the mutex protects would be good. And on the lock ordering.