Skip to content

Commit

Permalink
ram: iterate phase
Browse files Browse the repository at this point in the history
We only need to synchronize the bitmap when the number of dirty pages is low.
Not every time that we call the function.

Signed-off-by: Juan Quintela <quintela@redhat.com>
  • Loading branch information
Juan Quintela committed Jul 20, 2012
1 parent b81e712 commit 00d94f3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions arch_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,6 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
int i;
uint64_t expected_time;

memory_global_sync_dirty_bitmap(get_system_memory());

bytes_transferred_last = bytes_transferred;
bwidth = qemu_get_clock_ns(rt_clock);

Expand Down Expand Up @@ -398,7 +396,13 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
DPRINTF("ram_save_live: expected(" PRIu64 ") <= max(" PRIu64 ")?\n",
expected_time, migrate_max_downtime());

return expected_time <= migrate_max_downtime();
if (expected_time <= migrate_max_downtime()) {
memory_global_sync_dirty_bitmap(get_system_memory());
expected_time = ram_save_remaining() * TARGET_PAGE_SIZE / bwidth;

return expected_time <= migrate_max_downtime();
}
return 0;
}

static int ram_save_complete(QEMUFile *f, void *opaque)
Expand Down

0 comments on commit 00d94f3

Please sign in to comment.