From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGox7-0001l7-HE for qemu-devel@nongnu.org; Fri, 21 Feb 2014 07:11:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGox2-00068E-Oa for qemu-devel@nongnu.org; Fri, 21 Feb 2014 07:11:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGox2-000689-H1 for qemu-devel@nongnu.org; Fri, 21 Feb 2014 07:11:32 -0500 Date: Fri, 21 Feb 2014 12:10:17 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20140221121017.GD2483@work-vm> References: <33183CC9F5247A488A2544077AF19020815C7EB9@SZXEMA503-MBS.china.huawei.com> <20140221110336.GB2483@work-vm> <33183CC9F5247A488A2544077AF19020815C824A@SZXEMA503-MBS.china.huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33183CC9F5247A488A2544077AF19020815C824A@SZXEMA503-MBS.china.huawei.com> Subject: Re: [Qemu-devel] [PATCH v2] XBZRLE: Fix qemu crash when resize the xbzrle cache List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gonglei (Arei)" Cc: "chenliang (T)" , "owasserm@redhat.com" , "qemu-devel@nongnu.org" , Juan Quintela * Gonglei (Arei) (arei.gonglei@huawei.com) wrote: > Hi, > > > +static void XBZRLE_cache_lock(void) > > > +{ > > > + qemu_mutex_lock(&XBZRLE.lock); > > > +} > > > + > > > +static void XBZRLE_cache_unlock(void) > > > +{ > > > + qemu_mutex_unlock(&XBZRLE.lock); > > > +} > > > + > > > > You might want to make these only bother with the lock if xbzrle is enabled > > - however actually, I think it's probably just best to keep them as is, > > and simple. > To be honest, we can't follow your meaning. Can you explain it in detail. These two functions are called from a few places, including ram_save_block even if xbzrle isn't enabled; I was just suggesting you might not want to check the lock if xbzrle is disabled; however, I think it's simpler to leave it as is, and doubt the overhead is worth the complexity. Dave -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK