From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqLRn-0005Id-9w for qemu-devel@nongnu.org; Thu, 07 May 2015 09:02:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqLRg-0008MW-AQ for qemu-devel@nongnu.org; Thu, 07 May 2015 09:02:39 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:38343) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqLRg-0008MQ-4r for qemu-devel@nongnu.org; Thu, 07 May 2015 09:02:32 -0400 Received: by wiun10 with SMTP id n10so58965583wiu.1 for ; Thu, 07 May 2015 06:02:31 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <554B6264.8060102@redhat.com> Date: Thu, 07 May 2015 15:02:28 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1429089983-24644-1-git-send-email-liang.z.li@intel.com> <1429089983-24644-9-git-send-email-liang.z.li@intel.com> In-Reply-To: <1429089983-24644-9-git-send-email-liang.z.li@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [v8 08/14] migration: Add the core code of multi-thread compression List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liang Li , qemu-devel@nongnu.org Cc: quintela@redhat.com, armbru@redhat.com, lcapitulino@redhat.com, amit.shah@redhat.com, yang.z.zhang@intel.com, dgilbert@redhat.com On 15/04/2015 11:26, Liang Li wrote: > + if (ret != RAM_SAVE_CONTROL_NOT_SUPP) { > + if (ret != RAM_SAVE_CONTROL_DELAYED) { > + if (bytes_xmit > 0) { > + acct_info.norm_pages++; I don't think you can mix non-atomic and atomic increments like this---or if you can, you really should document why. Perhaps you can add a counter to the CompressParam struct, and sum all counters in norm_mig_pages_transferred/norm_mig_bytes_transferred (the latter probably should just call norm_mig_pages_transferred)? Paolo > + } else if (bytes_xmit == 0) { > + acct_info.dup_pages++; > + } > + }