From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chIO2-00039L-K6 for qemu-devel@nongnu.org; Fri, 24 Feb 2017 11:06:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chINy-0003fc-9P for qemu-devel@nongnu.org; Fri, 24 Feb 2017 11:06:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49308) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1chINy-0003fE-2c for qemu-devel@nongnu.org; Fri, 24 Feb 2017 11:06:22 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4ED57C04B927 for ; Fri, 24 Feb 2017 16:06:22 +0000 (UTC) References: <20170206173306.20603-1-dgilbert@redhat.com> <20170206173306.20603-13-dgilbert@redhat.com> From: Laurent Vivier Message-ID: <310a2727-de95-97f0-aa3e-34d1774cbe41@redhat.com> Date: Fri, 24 Feb 2017 17:06:19 +0100 MIME-Version: 1.0 In-Reply-To: <20170206173306.20603-13-dgilbert@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 12/16] postcopy: Send whole huge pages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" , qemu-devel@nongnu.org, quintela@redhat.com Cc: aarcange@redhat.com On 06/02/2017 18:33, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > The RAM save code uses ram_save_host_page to send whole > host pages at a time; change this to use the host page size associated > with the RAM Block which may be a huge page. > > Signed-off-by: Dr. David Alan Gilbert > Reviewed-by: Juan Quintela > --- > migration/ram.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/migration/ram.c b/migration/ram.c > index 88d9444..2350f71 100644 > --- a/migration/ram.c > +++ b/migration/ram.c > @@ -1281,6 +1281,8 @@ static int ram_save_target_page(MigrationState *ms, QEMUFile *f, > * offset to point into the middle of a host page > * in which case the remainder of the hostpage is sent. > * Only dirty target pages are sent. > + * Note that the host page size may be a huge page for this > + * block. > * > * Returns: Number of pages written. > * > @@ -1299,6 +1301,8 @@ static int ram_save_host_page(MigrationState *ms, QEMUFile *f, > ram_addr_t dirty_ram_abs) > { > int tmppages, pages = 0; > + size_t pagesize = qemu_ram_pagesize(pss->block); > + > do { > tmppages = ram_save_target_page(ms, f, pss, last_stage, > bytes_transferred, dirty_ram_abs); > @@ -1309,7 +1313,7 @@ static int ram_save_host_page(MigrationState *ms, QEMUFile *f, > pages += tmppages; > pss->offset += TARGET_PAGE_SIZE; > dirty_ram_abs += TARGET_PAGE_SIZE; > - } while (pss->offset & (qemu_host_page_size - 1)); > + } while (pss->offset & (pagesize - 1)); > > /* The offset we leave with is the last one we looked at */ > pss->offset -= TARGET_PAGE_SIZE; > Reviewed-by: Laurent Vivier