From: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxx> Thanks to Peter's suggestion, i split the long series (1) and this is the first part. I am not sure if Dave is happy to @reduced-size, will change immediately if it's objected. :) Changelog in v2: 1) introduce a parameter to make the main thread wait for free thread thread to compress the data as current behavior based on the comments from Dave and Peter 2) description improvement for compression statistics, thanks for Eric's improvement 3) move the handle of zero page to the threads 4) fix the issue that the new dirtied page would be overwritten at the destination when we drop flush_compressed_data at the end of iteration which is pointed out by Dave (1) https://www.spinics.net/lists/kvm/msg169774.html Xiao Guangrong (8): migration: do not wait for free thread migration: fix counting normal page for compression migration: show the statistics of compression migration: introduce save_zero_page_to_file migration: drop the return value of do_compress_ram_page migration: move handle of zero page to the thread migration: hold the lock only if it is really needed migration: do not flush_compressed_data at the end of each iteration hmp.c | 21 +++++ include/qemu/queue.h | 1 + migration/migration.c | 32 +++++++ migration/migration.h | 1 + migration/ram.c | 244 +++++++++++++++++++++++++++++++++++++------------- migration/ram.h | 1 + qapi/migration.json | 49 ++++++++-- 7 files changed, 281 insertions(+), 68 deletions(-) -- 2.14.4