From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEeTJ-0006Iu-EI for qemu-devel@nongnu.org; Fri, 23 Jan 2015 08:40:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEeTE-0006UA-Cd for qemu-devel@nongnu.org; Fri, 23 Jan 2015 08:40:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEeTE-0006Tv-4H for qemu-devel@nongnu.org; Fri, 23 Jan 2015 08:40:20 -0500 Date: Fri, 23 Jan 2015 13:40:14 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20150123134013.GI2370@work-vm> References: <1418347746-15829-1-git-send-email-liang.z.li@intel.com> <1418347746-15829-10-git-send-email-liang.z.li@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1418347746-15829-10-git-send-email-liang.z.li@intel.com> Subject: Re: [Qemu-devel] [v3 09/13] migration: Make compression co-work with xbzrle List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liang Li Cc: quintela@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, lcapitulino@redhat.com, yang.z.zhang@intel.com * Liang Li (liang.z.li@intel.com) wrote: > Now, multiple thread compression can co-work with xbzrle. when > xbzrle is on, multiple thread compression will only work at the > first round of ram data sync. > > Signed-off-by: Liang Li > Signed-off-by: Yang Zhang > --- > arch_init.c | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/arch_init.c b/arch_init.c > index 4109ad7..14bc486 100644 > --- a/arch_init.c > +++ b/arch_init.c > @@ -905,8 +905,11 @@ static int ram_save_compressed_page(QEMUFile *f, RAMBlock* block, > * block, and all the pages in last block should have been sent > * out, keeping this order is important. > */ > - if (block != last_sent_block) { > - flush_compressed_data(f); > + if ((!ram_bulk_stage && migrate_use_xbzrle()) || > + block != last_sent_block) { > + if (block != last_sent_block) { > + flush_compressed_data(f); > + } > bytes_sent = save_zero_and_xbzrle_page(f, block, offset, > last_stage, NULL); > if (bytes_sent == -1) { > @@ -961,6 +964,12 @@ static int ram_find_and_save_block(QEMUFile *f, bool last_stage) > block = QTAILQ_FIRST(&ram_list.blocks); > complete_round = true; > ram_bulk_stage = false; > + if (migrate_use_xbzrle()) { > + /* if xbzrle is on, we terminate the compression thread > + * at this point, there is no benefit from muti-thead */ Typo: 'muti-thead' -> 'multi-thread' Dave > + flush_compressed_data(f); > + terminate_compression_threads(); > + } > } > } else { > if (migrate_use_compression()) { > -- > 1.8.3.1 > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK