From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaxFS-0006hl-Ta for qemu-devel@nongnu.org; Wed, 25 Mar 2015 22:10:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaxFR-0003b5-A9 for qemu-devel@nongnu.org; Wed, 25 Mar 2015 22:10:18 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:37132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaxFQ-0003ad-UK for qemu-devel@nongnu.org; Wed, 25 Mar 2015 22:10:17 -0400 Date: Thu, 26 Mar 2015 12:31:13 +1100 From: David Gibson Message-ID: <20150326013113.GE28039@voom.redhat.com> References: <1424883128-9841-1-git-send-email-dgilbert@redhat.com> <1424883128-9841-34-git-send-email-dgilbert@redhat.com> <20150324015307.GX25043@voom.fritz.box> <20150325173733.GJ2313@work-vm> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="84ND8YJRMFlzkrP4" Content-Disposition: inline In-Reply-To: <20150325173733.GJ2313@work-vm> Subject: Re: [Qemu-devel] [PATCH v5 33/45] Page request: Process incoming page request List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, quintela@redhat.com, qemu-devel@nongnu.org, amit.shah@redhat.com, pbonzini@redhat.com, yanghy@cn.fujitsu.com --84ND8YJRMFlzkrP4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 25, 2015 at 05:37:34PM +0000, Dr. David Alan Gilbert wrote: > * David Gibson (david@gibson.dropbear.id.au) wrote: > > On Wed, Feb 25, 2015 at 04:51:56PM +0000, Dr. David Alan Gilbert (git) = wrote: > > > From: "Dr. David Alan Gilbert" > > >=20 > > > On receiving MIG_RPCOMM_REQ_PAGES look up the address and > > > queue the page. > > >=20 > > > Signed-off-by: Dr. David Alan Gilbert > > > --- > > > arch_init.c | 55 +++++++++++++++++++++++++++++++++= ++++++++++ > > > include/exec/cpu-all.h | 2 -- > > > include/migration/migration.h | 21 +++++++++++++++++ > > > include/qemu/typedefs.h | 1 + > > > migration/migration.c | 33 +++++++++++++++++++++++++- > > > trace-events | 3 ++- > > > 6 files changed, 111 insertions(+), 4 deletions(-) > > >=20 > > > diff --git a/arch_init.c b/arch_init.c > > > index d2c4457..9d8fc6b 100644 > > > --- a/arch_init.c > > > +++ b/arch_init.c >=20 > >=20 > > > static void migrate_handle_rp_req_pages(MigrationState *ms, const ch= ar* rbname, > > > ram_addr_t start, ram_addr_t = len) > > > { > > > - trace_migrate_handle_rp_req_pages(start, len); > > > + trace_migrate_handle_rp_req_pages(rbname, start, len); > > > + > > > + /* Round everything up to our host page size */ > > > + long our_host_ps =3D getpagesize(); > > > + if (start & (our_host_ps-1)) { > > > + long roundings =3D start & (our_host_ps-1); > > > + start -=3D roundings; > > > + len +=3D roundings; > > > + } > > > + if (len & (our_host_ps-1)) { > > > + long roundings =3D len & (our_host_ps-1); > > > + len -=3D roundings; > > > + len +=3D our_host_ps; > > > + } > >=20 > > Why is it necessary to round out to host page size on the source? I > > understand why the host page size is relevant on the destination, due > > to the userfaultfd and atomic populate constraints, but not on the sour= ce. >=20 > In principal the request you get from the destination should already > be nicely aligned; but of course you can't actually trust it, so you > have to at least test for alignment. >=20 > Since the code has to send whole host pages to keep the > destination happy, it expects the requests that come out of the queue > to be host page aligned. I don't follow. It sounds like you'll only send non-aligned things if the destination (incorrectly) requests them. But in that case the only thing that the destination will mess up is itself, so where's the requirement to do anything on the source side? > At the moment we're only supporting matching page sizes, if we wanted > to support mismatches then it probably needs to round to the size of > destination host page sizes. And can't that effectively be done by just answering the requests exactly as the destination makes them? --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --84ND8YJRMFlzkrP4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVE2FhAAoJEGw4ysog2bOSE+YP/RkgtKdkHz4ULGgNNSzTL1A+ HGIy8m7H27hDQ4ibknvM2S0Deu9sQr6kVMhUVl8kzQMA3PfhLZQ/iERWAo62b/r9 VQ7Xfor2UbWpM8udXl2h67CpFSQ80xHhscWa+nUOaG+8q/E0kskM7NxJcmABdomD w0ObbxuoZ1TxYwyLiR/Pi5rz8dauhWMUAFDXC7Gg7milI/xlUSOt9eN/IpzTsm3s GYgwbJJwUw9DJaS68IQ4bMwOnXFMmvjf/lSl3hIitrwq3/x3qKNhcdT6lfnOdVGR VUqM8yhXUepYSfyORuPnrCJg7LJjJK065jPMSNjEB9MF44NP7qCHkhthOH2BqTfe INXw9SIYQYkBRhDKjDNChNoo1Of3TabAjQ7VNz4Q2JzA02dlQgQqA1Vmdl7GW/D/ CNfzqXL3Gow5gk8zGQ0KBlVnU71t2JDD1QjYsZyHkjzGbw5iVdP+W1lXmBrU19FK 8OBtb6v8Vudj8B5GvFZa9UaTGDFDb1t24TjiJm02MNbGSd8mQbnIX1myrT+c4Dwf j1hwdzuu1D4JQlaqa7CsW/rtqUpQzgwJvKeGEd6Jj5Mj85H7fsZsiA1FF5USo8Sh eK3A4ezWgOUKIPgrpou+D41vEg+fxwS+aEgbySMCi6aRHURKYllN5N9tM89P6kCI R1U55472eYRV1l7TJmkU =B1ZA -----END PGP SIGNATURE----- --84ND8YJRMFlzkrP4--