From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [PATCH v2 03/10] migration: stop decompression to allocate and free memory frequently Date: Thu, 29 Mar 2018 12:14:30 +0800 Message-ID: <20180329041430.GB8456@xz-mi> References: <20180327091043.30220-1-xiaoguangrong@tencent.com> <20180327091043.30220-4-xiaoguangrong@tencent.com> <20180328094239.GF29554@xz-mi> 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: Xiao Guangrong Return-path: Content-Disposition: inline In-Reply-To: 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 Thu, Mar 29, 2018 at 11:43:07AM +0800, Xiao Guangrong wrote: > > > On 03/28/2018 05:42 PM, Peter Xu wrote: > > On Tue, Mar 27, 2018 at 05:10:36PM +0800, guangrong.xiao@gmail.com wrote: > > > > [...] > > > > > +static int compress_threads_load_setup(void) > > > +{ > > > + int i, thread_count; > > > + > > > + if (!migrate_use_compression()) { > > > + return 0; > > > + } > > > + > > > + thread_count = migrate_decompress_threads(); > > > + decompress_threads = g_new0(QemuThread, thread_count); > > > + decomp_param = g_new0(DecompressParam, thread_count); > > > + qemu_mutex_init(&decomp_done_lock); > > > + qemu_cond_init(&decomp_done_cond); > > > + for (i = 0; i < thread_count; i++) { > > > + if (inflateInit(&decomp_param[i].stream) != Z_OK) { > > > + goto exit; > > > + } > > > + decomp_param[i].stream.opaque = &decomp_param[i]; > > > > Same question as the encoding patch here, otherwise looks good to me. > > Thanks for you pointed out, will fix. > > Hmm, can i treat it as your Reviewed-by for the next version? Yes :), as long as we drop the usage of zstream.opaque and use any existing fields. And also for the previous patch too, since they are mostly the same. Thanks, -- Peter Xu