On Fri, Oct 03, 2014 at 06:47:36PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" <dgilb...@redhat.com> > > 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. > > 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. -- 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
pgp8wk1mr5uUr.pgp
Description: PGP signature