From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52675) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlugY-0000vb-Mz for qemu-devel@nongnu.org; Wed, 05 Nov 2014 02:07:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlugW-00071E-PN for qemu-devel@nongnu.org; Wed, 05 Nov 2014 02:07:18 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:36878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlugW-000708-C2 for qemu-devel@nongnu.org; Wed, 05 Nov 2014 02:07:16 -0500 Date: Wed, 5 Nov 2014 17:38:35 +1100 From: David Gibson Message-ID: <20141105063835.GA26255@voom.redhat.com> References: <1412358473-31398-1-git-send-email-dgilbert@redhat.com> <1412358473-31398-31-git-send-email-dgilbert@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline In-Reply-To: <1412358473-31398-31-git-send-email-dgilbert@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 30/47] Postcopy: Maintain sentmap and calculate discard List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, lilei@linux.vnet.ibm.com, quintela@redhat.com, cristian.klein@cs.umu.se, qemu-devel@nongnu.org, amit.shah@redhat.com, yanghy@cn.fujitsu.com --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 03, 2014 at 06:47:36PM +0100, Dr. David Alan Gilbert (git) wrot= e: > From: "Dr. David Alan Gilbert" >=20 > Where postcopy is preceeded by a period of precopy, the destination will > have received pages that may have been dirtied on the source after the > page was sent. The destination must throw these pages away before > starting it's CPUs. >=20 > Maintain a 'sentmap' of pages that have already been sent. > Calculate list of sent & dirty pages > Provide helpers on the destination side to discard these. I find this one really hard to wrap my head around, and I'm having trouble putting my finger on why. I do wonder if the "base + tiny bitmap" encodinng for the discard list over the wire is the best choice. It seems to involve a bunch of rather tedious code rejigging the bitmap into 32-bit chunks, and a bunch of rather hard to follow code moving back and forth between that encoding and simple address or page ranges for handling the actual discards. It also involves sending the bit offsets for the start of each ram block over the wire, which feels like it should be an internal detail. Would just a simple list of start..end or start/len pairs end up simpler overall? Converting the bitmap used to track it on the source into ranges would be a little fiddly, but I suspect less so than the code to split into 32-bit pieces. It might also be a bit more robust against possible future options for source host vs. dest host vs. target page size, since the source can construct it in terms if its granularity constraints, and destination can round each chunk out to its own granularity. --=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 --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUWcXrAAoJEGw4ysog2bOS+zsQANK4RJD/BGmP6zDmEPyHPc8A kqZ6tRAGdSnga36pnRKDsXLGgPmBJMgGmZ+cmr72L5vuhROtu9kxS/ZRx5pnWJod nAf/nI+8ZVQRrreq+9Ber1t0u7VOhwa77HXS1fxa7eWvW3cSOWWJFDXOTl9PIGOH rjvhkF4kKuy9dYEvXBq/oE4iCfVE6iouOU5PI0TYNXd3pofNV/BuVdtTL/5B+eiM DFOwqVpUWxcZuaAEDi97n0SDSU7vxzUJ/qt2U4GkrgOnj9cjVn+3qsPkJlf5fG7c hQiXd5SyvOMOlJ9Xrjl/QUQqedgEKZIBRKMZqbiqzZpV3oXApy5meoBS6NEP/1yE 93RkmKgAKtfCwj/lCq3/RcvoeSA0ONypjig56j3xeS/hW7EQhi60Dp5Oz2V7LwSG L8NQZLfrGAPMytavFOM5enIadPgamB6SSB9MdQdwrn3l4Mn9pTV3rbFbZX+yx+ri Ez9IIzyZb+2LSlqDbXv1vYDervFhCDTbMrDQ6CvHgzQDO9D2MJd0ALwIVeOeYXfs d/KrxbljLzqGUIpKm99c+/Fd64zxK5/2FYV6rrrZ7UFPOwvQjMItZYX8VrODjHCy 6+Bw6G/PrRj4SsLYsQWyICxrYJVIM0+KVVCBL089ZPypvYOvJJnGtYqcYyizxp5T dniddnqramzicAyzJ1sA =LTR6 -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb--