From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axXof-000637-SW for qemu-devel@nongnu.org; Tue, 03 May 2016 06:44:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axXoT-0005pS-Rz for qemu-devel@nongnu.org; Tue, 03 May 2016 06:44:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axXoT-0005jH-NF for qemu-devel@nongnu.org; Tue, 03 May 2016 06:44:21 -0400 Date: Tue, 3 May 2016 11:44:05 +0100 From: "Daniel P. Berrange" Message-ID: <20160503104405.GG21360@redhat.com> Reply-To: "Daniel P. Berrange" References: <1462257521-16075-1-git-send-email-liang.z.li@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1462257521-16075-1-git-send-email-liang.z.li@intel.com> Subject: Re: [Qemu-devel] [PATCH] migration: Fix multi-thread compression bug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liang Li Cc: qemu-devel@nongnu.org, amit.shah@redhat.com, dgilbert@redhat.com, quintela@redhat.com On Tue, May 03, 2016 at 02:38:41PM +0800, Liang Li wrote: > Recently, a bug related to multiple thread compression feature for > live migration is reported. The destination side will be blocked > during live migration if there are heavy workload in host and > memory intensive workload in guest, this is most likely to happen > when there is one decompression thread. > > Some parts of the decompression code are incorrect: > 1. The main thread receives data from source side will enter a busy > loop to wait for a free decompression thread. > 2. A lock is needed to protect the decomp_param[idx]->start, because > it is checked in the main thread and is updated in the decompression > thread. > > Fix these two issues by following the code pattern for compression. > > Reported-by: Daniel P. Berrange > Signed-off-by: Liang Li > --- > migration/ram.c | 38 +++++++++++++++++++++++++++----------- > 1 file changed, 27 insertions(+), 11 deletions(-) Tested-by: Daniel P. Berrange Reviewed-by: Daniel P. Berrange Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|