[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 33/35] ram: remove xbrle last_stage optimization
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 33/35] ram: remove xbrle last_stage optimization |
Date: |
Tue, 11 Dec 2012 13:47:09 +0100 |
We need to remove it to be able to return from complete to iterative
phases of migration.
Signed-off-by: Juan Quintela <address@hidden>
---
arch_init.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index f5f9324..6a4ee24 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -286,16 +286,14 @@ static size_t save_block_hdr(QEMUFile *f, RAMBlock
*block, ram_addr_t offset,
static int save_xbzrle_page(QEMUFile *f, uint8_t *current_data,
ram_addr_t current_addr, RAMBlock *block,
- ram_addr_t offset, int cont, bool last_stage)
+ ram_addr_t offset, int cont)
{
int encoded_len = 0, bytes_sent = -1;
uint8_t *prev_cached_page;
if (!cache_is_cached(XBZRLE.cache, current_addr)) {
- if (!last_stage) {
- cache_insert(XBZRLE.cache, current_addr,
- g_memdup(current_data, TARGET_PAGE_SIZE));
- }
+ cache_insert(XBZRLE.cache, current_addr,
+ g_memdup(current_data, TARGET_PAGE_SIZE));
acct_info.xbzrle_cache_miss++;
return -1;
}
@@ -321,9 +319,7 @@ static int save_xbzrle_page(QEMUFile *f, uint8_t
*current_data,
}
/* we need to update the data in the cache, in order to get the same data
*/
- if (!last_stage) {
- memcpy(prev_cached_page, XBZRLE.current_buf, TARGET_PAGE_SIZE);
- }
+ memcpy(prev_cached_page, XBZRLE.current_buf, TARGET_PAGE_SIZE);
/* Send XBZRLE based compressed page */
bytes_sent = save_block_hdr(f, block, offset, cont, RAM_SAVE_FLAG_XBZRLE);
@@ -426,7 +422,7 @@ static void migration_bitmap_sync(void)
* 0 means no dirty pages
*/
-static int ram_save_block(QEMUFile *f, bool last_stage)
+static int ram_save_block(QEMUFile *f)
{
RAMBlock *block = last_seen_block;
ram_addr_t offset = last_offset;
@@ -470,10 +466,8 @@ static int ram_save_block(QEMUFile *f, bool last_stage)
} else if (migrate_use_xbzrle()) {
current_addr = block->offset + offset;
bytes_sent = save_xbzrle_page(f, p, current_addr, block,
- offset, cont, last_stage);
- if (!last_stage) {
- p = get_cached_data(XBZRLE.cache, current_addr);
- }
+ offset, cont);
+ p = get_cached_data(XBZRLE.cache, current_addr);
}
/* XBZRLE overflow or normal page */
@@ -647,7 +641,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque,
uint64_t free_space)
i = 0;
/* We need space for at least one page and end of section marker */
while (free_space > MAX_PAGE_SIZE + 8) {
- int bytes_sent = ram_save_block(f, false);
+ int bytes_sent = ram_save_block(f);
/* no more blocks to sent */
if (bytes_sent == 0) {
break;
@@ -691,7 +685,7 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
while (true) {
int bytes_sent;
- bytes_sent = ram_save_block(f, true);
+ bytes_sent = ram_save_block(f);
/* no more blocks to sent */
if (bytes_sent == 0) {
break;
--
1.7.11.7
- [Qemu-devel] [PATCH 27/35] ram: Use memory_region_test_and_clear_dirty, (continued)
- [Qemu-devel] [PATCH 27/35] ram: Use memory_region_test_and_clear_dirty, Juan Quintela, 2012/12/11
- [Qemu-devel] [PATCH 26/35] memory: introduce memory_region_test_and_clear_dirty, Juan Quintela, 2012/12/11
- [Qemu-devel] [PATCH 24/35] ram: rename last_block to last_seen_block, Juan Quintela, 2012/12/11
- [Qemu-devel] [PATCH 35/35] migration: print times for end phase, Juan Quintela, 2012/12/11
- [Qemu-devel] [PATCH 32/35] ram: add free_space parameter to save_live functions, Juan Quintela, 2012/12/11
- [Qemu-devel] [PATCH 30/35] ram: account the amount of transferred ram better, Juan Quintela, 2012/12/11
- [Qemu-devel] [PATCH 29/35] ram: optimize migration bitmap walking, Juan Quintela, 2012/12/11
- [Qemu-devel] [PATCH 31/35] ram: refactor ram_save_block() return value, Juan Quintela, 2012/12/11
- [Qemu-devel] [PATCH 34/35] ram: reuse ram_save_iterate() for the complete stage, Juan Quintela, 2012/12/11
- Re: [Qemu-devel] [PATCH 00/35] Migration thread (20121211), Paolo Bonzini, 2012/12/11
- [Qemu-devel] [PATCH 33/35] ram: remove xbrle last_stage optimization,
Juan Quintela <=