From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj7UC-0001nC-5P for qemu-devel@nongnu.org; Thu, 24 Mar 2016 11:47:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj7U8-0002mO-4k for qemu-devel@nongnu.org; Thu, 24 Mar 2016 11:47:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57009) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj7U7-0002mI-V4 for qemu-devel@nongnu.org; Thu, 24 Mar 2016 11:47:44 -0400 References: <20160322101116.GA9532@redhat.com> <20160323155325-mutt-send-email-mst@redhat.com> <20160324094846.GA17006@redhat.com> <20160324122627-mutt-send-email-mst@redhat.com> <20160324164006-mutt-send-email-mst@redhat.com> <20160324171759-mutt-send-email-mst@redhat.com> From: Paolo Bonzini Message-ID: <56F40C18.3020305@redhat.com> Date: Thu, 24 Mar 2016 16:47:36 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC Design Doc]Speed up live migration by skipping free pages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Li, Liang Z" , "Michael S. Tsirkin" Cc: "rkagan@virtuozzo.com" , "linux-kernel@vger.kenel.org" , "ehabkost@redhat.com" , "kvm@vger.kernel.org" , "quintela@redhat.com" , "simhan@hpe.com" , "qemu-devel@nongnu.org" , "dgilbert@redhat.com" , "jitendra.kolhe@hpe.com" , "mohan_parthasarathy@hpe.com" , "amit.shah@redhat.com" , "rth@twiddle.net" On 24/03/2016 16:39, Li, Liang Z wrote: > > Only if you write the arch specific thing for all arches. > > I plan to keep a function stub for each arch to implement. And I > have done that for X86. Again: the ram_addr_t matching is internal to QEMU and can vary from release to release. Do not do this. > > I think the reason for the speedup that you observe is that you only need to > > translate ram_addr_t to GPA once per ramblock, which is much faster than > > translating GPA to ram_addr_t for each page. > > Yes, exactly! You don't need to translate it once per page. When QEMU copies the bitmap from guest memory to its own internal data structures, it can do so one block at a time with a function like void bitmap_copy_bits(unsigned long *dst, unsigned int dst_start, unsigned long *src, unsigned int src_start unsigned int nbits); Paolo