> hmm, multiple thread compression can't co-work with xbzrle. xbzrle need > guarantee the cache at src is same to dest. But I dont see that below: > > + /* XBZRLE overflow or normal page */ > + if (bytes_sent == -1) { > + bytes_sent = migrate_save_block_hdr(¶m->migbuf, block, > + offset, cont, RAM_SAVE_FLAG_COMPRESS_PAGE); > + blen = migrate_qemu_add_compress(¶m->migbuf, p, > + TARGET_PAGE_SIZE, migrate_compress_level()); > + bytes_sent += blen; > + atomic_inc(&acct_info.norm_pages); > > the code don't update the cache of xbzrle at src.
It's updated here.. + } else if (is_zero_range(p, TARGET_PAGE_SIZE)) { + atomic_inc(&acct_info.dup_pages); + bytes_sent = migrate_save_block_hdr(¶m->migbuf, block, offset, cont, + RAM_SAVE_FLAG_COMPRESS); + migrate_put_byte(¶m->migbuf, 0); + bytes_sent++; + /* Must let xbzrle know, otherwise a previous (now 0'd) cached + * page would be stale + */ + xbzrle_cache_zero_page(current_addr); + } else if (!param->bulk_stage && migrate_use_xbzrle()) { + bytes_sent = save_xbzrle_page(¶m->migbuf, &p, current_addr, block, + offset, cont, last_stage, true); + }