The first iteration's RAMBlock dirty sync can be omitted because QEMU always initializes the RAMBlock's bmap to all 1s by default.
Prior to that, a pre-requisite patch was offered to maintain the free page optimizing behavior. For more details, please refers to: https://lore.kernel.org/qemu-devel/cak9dgmzsmoydjkfqp5vxfn21etmzc_bnq51r+if08f+ntap...@mail.gmail.com/T/#t Please review, thanks Yong Hyman Huang (2): virtio-balloon: Enable free page hinting during PRECOPY_NOTIFY_SETUP migration: Do not perform RAMBlock dirty sync during the first iteration hw/virtio/virtio-balloon.c | 2 +- migration/cpu-throttle.c | 2 +- migration/ram.c | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) -- 2.39.1