On 28/04/2021 12:03, Olaf Hering wrote: > Am Wed, 28 Apr 2021 12:42:54 +0200 > schrieb Jan Beulich <jbeul...@suse.com>: > >> It might help if you would outline what you're actually after by >> knowing a domain's active grants. > There is REC_TYPE_VERIFY, which will re-transmit all memory of a paused domU > and compare what was previously transferred. Last time I used it a large > number of pages are different. I did not spent time to dig further into it, > what pfns are affected, how the pages differ. I suspect the backends do still > write into the granted pages, hence the question. > > I think the domU may undo all grants during its suspend anyway, that is > something to explore as well.
Grants are not properly accounted for in the logdirty bitmap, because they're not unmapped during the final phase. This came as an unexpected surprise when I was doing migration v2. You really will see `--debug` identify dirty frames, but its "fine", allegedly. The reason is that frontends and backends can't disconnect while the VM is paused, and will continue to process outstanding IO. The reason this doesn't explode on the destination is because the guest kernel replays the command ring. Disks get possibly re-issued read/writes. Networks really does drop some to-guest packets, and may send duplicate to-host packets - TCP handles this normal mechanisms, and UDP is UDP. Other PV protocols will encounter similar problems. I didn't get the impression that this behaviour was intentional in the first place, and its certainly not something you'd deliberately design. It appears to have been a consequence of how PV guests evolved, where kernel cooperation on migrate is mandatory, which caused kernel cooperation to be mandatory for the paravirt driver pairs too. ~Andrew