[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [v3 09/13] migration: Make compression co-work with xbzrle
From: |
Liang Li |
Subject: |
[Qemu-devel] [v3 09/13] migration: Make compression co-work with xbzrle |
Date: |
Fri, 12 Dec 2014 09:29:02 +0800 |
Now, multiple thread compression can co-work with xbzrle. when
xbzrle is on, multiple thread compression will only work at the
first round of ram data sync.
Signed-off-by: Liang Li <address@hidden>
Signed-off-by: Yang Zhang <address@hidden>
---
arch_init.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index 4109ad7..14bc486 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -905,8 +905,11 @@ static int ram_save_compressed_page(QEMUFile *f, RAMBlock*
block,
* block, and all the pages in last block should have been sent
* out, keeping this order is important.
*/
- if (block != last_sent_block) {
- flush_compressed_data(f);
+ if ((!ram_bulk_stage && migrate_use_xbzrle()) ||
+ block != last_sent_block) {
+ if (block != last_sent_block) {
+ flush_compressed_data(f);
+ }
bytes_sent = save_zero_and_xbzrle_page(f, block, offset,
last_stage, NULL);
if (bytes_sent == -1) {
@@ -961,6 +964,12 @@ static int ram_find_and_save_block(QEMUFile *f, bool
last_stage)
block = QTAILQ_FIRST(&ram_list.blocks);
complete_round = true;
ram_bulk_stage = false;
+ if (migrate_use_xbzrle()) {
+ /* if xbzrle is on, we terminate the compression thread
+ * at this point, there is no benefit from muti-thead */
+ flush_compressed_data(f);
+ terminate_compression_threads();
+ }
}
} else {
if (migrate_use_compression()) {
--
1.8.3.1
- [Qemu-devel] [PATCH v3 0/13] migration: Add a new feature to do live migration, Liang Li, 2014/12/11
- [Qemu-devel] [v3 01/13] docs: Add a doc about multiple thread compression, Liang Li, 2014/12/11
- [Qemu-devel] [v3 04/13] qemu-file: Add tow function will be used in migration, Liang Li, 2014/12/11
- [Qemu-devel] [v3 05/13] arch_init: alloc and free data struct in multi-thread compression, Liang Li, 2014/12/11
- [Qemu-devel] [v3 02/13] migration: Add the framework of multi-thread compression, Liang Li, 2014/12/11
- [Qemu-devel] [v3 06/13] arch_init: Add data struct used by decompression, Liang Li, 2014/12/11
- [Qemu-devel] [v3 03/13] migration: Add the framework of muti-thread decompression, Liang Li, 2014/12/11
- [Qemu-devel] [v3 07/13] migraion: Rewrite the function ram_save_page(), Liang Li, 2014/12/11
- [Qemu-devel] [v3 08/13] migration: Add the core code of multi-thread compresion, Liang Li, 2014/12/11
- [Qemu-devel] [v3 09/13] migration: Make compression co-work with xbzrle,
Liang Li <=
- [Qemu-devel] [v3 10/13] migration: Add the core code of multi-thread decompression, Liang Li, 2014/12/11
- [Qemu-devel] [v3 11/13] migration: Add interface to control compression, Liang Li, 2014/12/11
- [Qemu-devel] [v3 12/13] migration: Add command to set migration parameter, Liang Li, 2014/12/11
- [Qemu-devel] [v3 13/13] migration: Add command to query migration parameter, Liang Li, 2014/12/11
- Re: [Qemu-devel] [PATCH v3 0/13] migration: Add a new feature to do live migration, Li, Liang Z, 2014/12/24