From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTM4D-0000Sh-2C for qemu-devel@nongnu.org; Thu, 14 Jun 2018 02:49:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTM48-0005Uq-4f for qemu-devel@nongnu.org; Thu, 14 Jun 2018 02:49:09 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:45954) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTM47-0005Ui-UT for qemu-devel@nongnu.org; Thu, 14 Jun 2018 02:49:04 -0400 Received: by mail-pg0-x242.google.com with SMTP id z1-v6so2448858pgv.12 for ; Wed, 13 Jun 2018 23:49:03 -0700 (PDT) References: <20180604095520.8563-1-xiaoguangrong@tencent.com> <20180604095520.8563-6-xiaoguangrong@tencent.com> <20180613162508.GM2676@work-vm> From: Xiao Guangrong Message-ID: Date: Thu, 14 Jun 2018 14:48:55 +0800 MIME-Version: 1.0 In-Reply-To: <20180613162508.GM2676@work-vm> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/12] migration: show the statistics of compression List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: pbonzini@redhat.com, mst@redhat.com, mtosatti@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, peterx@redhat.com, jiang.biao2@zte.com.cn, wei.w.wang@intel.com, Xiao Guangrong On 06/14/2018 12:25 AM, Dr. David Alan Gilbert wrote: } >> >> static void migration_bitmap_sync(RAMState *rs) >> @@ -1412,6 +1441,9 @@ static void flush_compressed_data(RAMState *rs) >> qemu_mutex_lock(&comp_param[idx].mutex); >> if (!comp_param[idx].quit) { >> len = qemu_put_qemu_file(rs->f, comp_param[idx].file); >> + /* 8 means a header with RAM_SAVE_FLAG_CONTINUE. */ >> + compression_counters.reduced_size += TARGET_PAGE_SIZE - len + 8; > > I think I'd rather save just len+8 rather than than the subtraction. > Hmmmmmm, is this what you want? compression_counters.reduced_size += len - 8; Then calculate the real reduced size in populate_ram_info() where we return this info to the user: info->compression->reduced_size = compression_counters.pages * PAGE_SIZE - compression_counters.reduced_size; Right? > I think other than that, and Eric's comments, it's OK. > Thanks.