From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqMd5-0006sK-Ii for qemu-devel@nongnu.org; Thu, 07 May 2015 10:18:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqMd1-00038U-As for qemu-devel@nongnu.org; Thu, 07 May 2015 10:18:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqMd1-00038K-5Q for qemu-devel@nongnu.org; Thu, 07 May 2015 10:18:19 -0400 Message-ID: <554B7423.8080509@redhat.com> Date: Thu, 07 May 2015 16:18:11 +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> <554B6264.8060102@redhat.com> <20150507141359.GG2139@work-vm> In-Reply-To: <20150507141359.GG2139@work-vm> 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: "Dr. David Alan Gilbert" Cc: quintela@redhat.com, qemu-devel@nongnu.org, Liang Li , armbru@redhat.com, lcapitulino@redhat.com, amit.shah@redhat.com, yang.z.zhang@intel.com On 07/05/2015 16:13, Dr. David Alan Gilbert wrote: >> > 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)? > The 'ram_save_compressed_page' that Liang Li has added here is basically > the same as the ram_save_page we've already got but with the extra > bits for compression, and this non-atomic inc is in the code simply copied > to handle the 'ram_control_save_page' case (i.e. RDMA). > > So it is safe, because I don't think any pages will get handed to the > compression threads (and hence hit the atomic inc's) if RDMA is hooking > the ram_control_save_page. Right, but still it depends on RDMA handling all pages with no exception. So it's still pretty ugly, even if it happens to work. Paolo