mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20180627' into staging
migration/next for 20180627 # gpg: Signature made Wed 27 Jun 2018 13:53:53 BST # gpg: using RSA key F487EF185872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" # gpg: aka "Juan Quintela <quintela@trasno.org>" # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03 4B82 F487 EF18 5872 D723 * remotes/juanquintela/tags/migration/20180627: migration: fix crash in when incoming client channel setup fails postcopy: drop ram_pages parameter from postcopy_ram_incoming_init() migration: Stop sending whole pages through main channel migration: Remove not needed semaphore and quit migration: Wait for blocking IO migration: Start sending messages migration: Create ram_save_multifd_page migration: Create multifd_bytes ram_counter migration: Synchronize multifd threads with main thread migration: Add block where to send/receive packets migration: Multifd channels always wait on the sem migration: Add multifd traces for start/end thread migration: Abstract the number of bytes sent migration: Calculate mbps only during transfer time migration: Create multifd packet migration: Create multipage support Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -1930,7 +1930,7 @@ static ram_addr_t find_ram_offset(ram_addr_t size)
|
||||
return offset;
|
||||
}
|
||||
|
||||
unsigned long last_ram_page(void)
|
||||
static unsigned long last_ram_page(void)
|
||||
{
|
||||
RAMBlock *block;
|
||||
ram_addr_t last = 0;
|
||||
|
||||
@@ -234,6 +234,8 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
|
||||
info->ram->dirty_sync_count);
|
||||
monitor_printf(mon, "page size: %" PRIu64 " kbytes\n",
|
||||
info->ram->page_size >> 10);
|
||||
monitor_printf(mon, "multifd bytes: %" PRIu64 " kbytes\n",
|
||||
info->ram->multifd_bytes >> 10);
|
||||
|
||||
if (info->ram->dirty_pages_rate) {
|
||||
monitor_printf(mon, "dirty pages rate: %" PRIu64 " pages\n",
|
||||
|
||||
@@ -71,7 +71,6 @@ static inline unsigned long int ramblock_recv_bitmap_offset(void *host_addr,
|
||||
}
|
||||
|
||||
long qemu_getrampagesize(void);
|
||||
unsigned long last_ram_page(void);
|
||||
RAMBlock *qemu_ram_alloc_from_file(ram_addr_t size, MemoryRegion *mr,
|
||||
bool share, const char *mem_path,
|
||||
Error **errp);
|
||||
|
||||
+18
-6
@@ -518,11 +518,12 @@ void migration_ioc_process_incoming(QIOChannel *ioc)
|
||||
*/
|
||||
bool migration_has_all_channels(void)
|
||||
{
|
||||
MigrationIncomingState *mis = migration_incoming_get_current();
|
||||
bool all_channels;
|
||||
|
||||
all_channels = multifd_recv_all_channels_created();
|
||||
|
||||
return all_channels;
|
||||
return all_channels && mis->from_src_file != NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -708,6 +709,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s)
|
||||
info->ram->dirty_sync_count = ram_counters.dirty_sync_count;
|
||||
info->ram->postcopy_requests = ram_counters.postcopy_requests;
|
||||
info->ram->page_size = qemu_target_page_size();
|
||||
info->ram->multifd_bytes = ram_counters.multifd_bytes;
|
||||
|
||||
if (migrate_use_xbzrle()) {
|
||||
info->has_xbzrle_cache = true;
|
||||
@@ -2704,10 +2706,17 @@ static MigThrError migration_detect_error(MigrationState *s)
|
||||
}
|
||||
}
|
||||
|
||||
/* How many bytes have we transferred since the beggining of the migration */
|
||||
static uint64_t migration_total_bytes(MigrationState *s)
|
||||
{
|
||||
return qemu_ftell(s->to_dst_file) + ram_counters.multifd_bytes;
|
||||
}
|
||||
|
||||
static void migration_calculate_complete(MigrationState *s)
|
||||
{
|
||||
uint64_t bytes = qemu_ftell(s->to_dst_file);
|
||||
uint64_t bytes = migration_total_bytes(s);
|
||||
int64_t end_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
|
||||
int64_t transfer_time;
|
||||
|
||||
s->total_time = end_time - s->start_time;
|
||||
if (!s->downtime) {
|
||||
@@ -2718,8 +2727,9 @@ static void migration_calculate_complete(MigrationState *s)
|
||||
s->downtime = end_time - s->downtime_start;
|
||||
}
|
||||
|
||||
if (s->total_time) {
|
||||
s->mbps = ((double) bytes * 8.0) / s->total_time / 1000;
|
||||
transfer_time = s->total_time - s->setup_time;
|
||||
if (transfer_time) {
|
||||
s->mbps = ((double) bytes * 8.0) / transfer_time / 1000;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2727,13 +2737,15 @@ static void migration_update_counters(MigrationState *s,
|
||||
int64_t current_time)
|
||||
{
|
||||
uint64_t transferred, time_spent;
|
||||
uint64_t current_bytes; /* bytes transferred since the beginning */
|
||||
double bandwidth;
|
||||
|
||||
if (current_time < s->iteration_start_time + BUFFER_DELAY) {
|
||||
return;
|
||||
}
|
||||
|
||||
transferred = qemu_ftell(s->to_dst_file) - s->iteration_initial_bytes;
|
||||
current_bytes = migration_total_bytes(s);
|
||||
transferred = current_bytes - s->iteration_initial_bytes;
|
||||
time_spent = current_time - s->iteration_start_time;
|
||||
bandwidth = (double)transferred / time_spent;
|
||||
s->threshold_size = bandwidth * s->parameters.downtime_limit;
|
||||
@@ -2752,7 +2764,7 @@ static void migration_update_counters(MigrationState *s,
|
||||
qemu_file_reset_rate_limit(s->to_dst_file);
|
||||
|
||||
s->iteration_start_time = current_time;
|
||||
s->iteration_initial_bytes = qemu_ftell(s->to_dst_file);
|
||||
s->iteration_initial_bytes = current_bytes;
|
||||
|
||||
trace_migrate_transferred(transferred, time_spent,
|
||||
bandwidth, s->threshold_size);
|
||||
|
||||
@@ -500,7 +500,7 @@ static int cleanup_range(const char *block_name, void *host_addr,
|
||||
* postcopy later; must be called prior to any precopy.
|
||||
* called from arch_init's similarly named ram_postcopy_incoming_init
|
||||
*/
|
||||
int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages)
|
||||
int postcopy_ram_incoming_init(MigrationIncomingState *mis)
|
||||
{
|
||||
if (qemu_ram_foreach_migratable_block(init_range, NULL)) {
|
||||
return -1;
|
||||
@@ -1265,7 +1265,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis)
|
||||
return false;
|
||||
}
|
||||
|
||||
int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages)
|
||||
int postcopy_ram_incoming_init(MigrationIncomingState *mis)
|
||||
{
|
||||
error_report("postcopy_ram_incoming_init: No OS support");
|
||||
return -1;
|
||||
|
||||
@@ -27,7 +27,7 @@ int postcopy_ram_enable_notify(MigrationIncomingState *mis);
|
||||
* postcopy later; must be called prior to any precopy.
|
||||
* called from ram.c's similarly named ram_postcopy_incoming_init
|
||||
*/
|
||||
int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages);
|
||||
int postcopy_ram_incoming_init(MigrationIncomingState *mis);
|
||||
|
||||
/*
|
||||
* At the end of a migration where postcopy_ram_incoming_init was called.
|
||||
|
||||
+474
-17
File diff suppressed because it is too large
Load Diff
@@ -76,6 +76,18 @@ get_queued_page_not_dirty(const char *block_name, uint64_t tmp_offset, unsigned
|
||||
migration_bitmap_sync_start(void) ""
|
||||
migration_bitmap_sync_end(uint64_t dirty_pages) "dirty_pages %" PRIu64
|
||||
migration_throttle(void) ""
|
||||
multifd_recv(uint8_t id, uint64_t packet_num, uint32_t used, uint32_t flags) "channel %d packet number %" PRIu64 " pages %d flags 0x%x"
|
||||
multifd_recv_sync_main(long packet_num) "packet num %ld"
|
||||
multifd_recv_sync_main_signal(uint8_t id) "channel %d"
|
||||
multifd_recv_sync_main_wait(uint8_t id) "channel %d"
|
||||
multifd_recv_thread_end(uint8_t id, uint64_t packets, uint64_t pages) "channel %d packets %" PRIu64 " pages %" PRIu64
|
||||
multifd_recv_thread_start(uint8_t id) "%d"
|
||||
multifd_send(uint8_t id, uint64_t packet_num, uint32_t used, uint32_t flags) "channel %d packet_num %" PRIu64 " pages %d flags 0x%x"
|
||||
multifd_send_sync_main(long packet_num) "packet num %ld"
|
||||
multifd_send_sync_main_signal(uint8_t id) "channel %d"
|
||||
multifd_send_sync_main_wait(uint8_t id) "channel %d"
|
||||
multifd_send_thread_end(uint8_t id, uint64_t packets, uint64_t pages) "channel %d packets %" PRIu64 " pages %" PRIu64
|
||||
multifd_send_thread_start(uint8_t id) "%d"
|
||||
ram_discard_range(const char *rbname, uint64_t start, size_t len) "%s: start: %" PRIx64 " %zx"
|
||||
ram_load_loop(const char *rbname, uint64_t addr, int flags, void *host) "%s: addr: 0x%" PRIx64 " flags: 0x%x host: %p"
|
||||
ram_load_postcopy_loop(uint64_t addr, int flags) "@%" PRIx64 " %x"
|
||||
|
||||
+4
-1
@@ -39,6 +39,8 @@
|
||||
# @page-size: The number of bytes per page for the various page-based
|
||||
# statistics (since 2.10)
|
||||
#
|
||||
# @multifd-bytes: The number of bytes sent through multifd (since 3.0)
|
||||
#
|
||||
# Since: 0.14.0
|
||||
##
|
||||
{ 'struct': 'MigrationStats',
|
||||
@@ -46,7 +48,8 @@
|
||||
'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
|
||||
'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
|
||||
'mbps' : 'number', 'dirty-sync-count' : 'int',
|
||||
'postcopy-requests' : 'int', 'page-size' : 'int' } }
|
||||
'postcopy-requests' : 'int', 'page-size' : 'int',
|
||||
'multifd-bytes' : 'uint64' } }
|
||||
|
||||
##
|
||||
# @XBZRLECacheStats:
|
||||
|
||||
Reference in New Issue
Block a user