From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrNy7-00005M-5i for qemu-devel@nongnu.org; Wed, 28 Oct 2015 06:28:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrNy2-0004ZY-2r for qemu-devel@nongnu.org; Wed, 28 Oct 2015 06:28:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrNy1-0004ZM-Tv for qemu-devel@nongnu.org; Wed, 28 Oct 2015 06:28:30 -0400 From: Juan Quintela In-Reply-To: <1443515898-3594-42-git-send-email-dgilbert@redhat.com> (David Alan Gilbert's message of "Tue, 29 Sep 2015 09:38:05 +0100") References: <1443515898-3594-1-git-send-email-dgilbert@redhat.com> <1443515898-3594-42-git-send-email-dgilbert@redhat.com> Date: Wed, 28 Oct 2015 11:28:26 +0100 Message-ID: <87d1vz9tit.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v8 41/54] postcopy_ram.c: place_page and helpers Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: aarcange@redhat.com, liang.z.li@intel.com, qemu-devel@nongnu.org, luis@cs.umu.se, bharata@linux.vnet.ibm.com, amit.shah@redhat.com, pbonzini@redhat.com "Dr. David Alan Gilbert (git)" wrote: > From: "Dr. David Alan Gilbert" > > postcopy_place_page (etc) provide a way for postcopy to place a page > into guests memory atomically (using the copy ioctl on the ufd). > > Signed-off-by: Dr. David Alan Gilbert > Reviewed-by: Amit Shah Reviewed-by: Juan Quintela > +int postcopy_place_page_zero(MigrationIncomingState *mis, void *host) > +{ > + struct uffdio_zeropage zero_struct; > + > + zero_struct.range.start = (uint64_t)(uintptr_t)host; > + zero_struct.range.len = getpagesize(); > + zero_struct.mode = 0; > + > + if (ioctl(mis->userfault_fd, UFFDIO_ZEROPAGE, &zero_struct)) { > + int e = errno; > + error_report("%s: %s zero host: %p", > + __func__, strerror(e), host); > + > + return -e; > + } > + > + trace_postcopy_place_page_zero(host); > + return 0; > +} Would this be faster than normal precopy way of just copying a zero page?