From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [PATCH v3 05/10] migration: move handle of zero page to the thread Date: Wed, 8 Aug 2018 12:39:26 +0800 Message-ID: <20180808043926.GE24415@xz-mi> References: <20180807091209.13531-1-xiaoguangrong@tencent.com> <20180807091209.13531-6-xiaoguangrong@tencent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: kvm@vger.kernel.org, mst@redhat.com, mtosatti@redhat.com, Xiao Guangrong , dgilbert@redhat.com, qemu-devel@nongnu.org, wei.w.wang@intel.com, jiang.biao2@zte.com.cn, pbonzini@redhat.com To: guangrong.xiao@gmail.com Return-path: Content-Disposition: inline In-Reply-To: <20180807091209.13531-6-xiaoguangrong@tencent.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel2=m.gmane.org@nongnu.org Sender: "Qemu-devel" List-Id: kvm.vger.kernel.org On Tue, Aug 07, 2018 at 05:12:04PM +0800, guangrong.xiao@gmail.com wrote: > From: Xiao Guangrong > > Detecting zero page is not a light work, moving it to the thread to > speed the main thread up, btw, handling ram_release_pages() for the > zero page is moved to the thread as well > > Signed-off-by: Xiao Guangrong > --- [...] > @@ -2239,17 +2290,10 @@ static int ram_save_target_page(RAMState *rs, PageSearchStatus *pss, > } > > /* > - * Make sure the first page is sent out before other pages. > - * > - * we post it as normal page as compression will take much > - * CPU resource. > + * do not use multifd for compression as the first page in the new > + * block should be posted out before sending the compressed page > */ > - if (block == rs->last_sent_block && save_page_use_compression(rs)) { > - res = compress_page_with_multi_thread(rs, block, offset); > - if (res > 0) { > - return res; > - } > - } else if (migrate_use_multifd()) { > + if (!save_page_use_compression(rs) && migrate_use_multifd()) { Not related to this patch: I think we should just disallow user to specify both compression and multifd together. I vaguely remembered that I left a comment somewhere in the multifd series but it must have fallen throw the cracks... Anyway it's not related to this patch: Reviewed-by: Peter Xu Thanks, > return ram_save_multifd_page(rs, block, offset); > } > > -- > 2.14.4 > -- Peter Xu