mirror_qemu/migration
Chao Fan 1ffb5dfd35 Change the method to calculate dirty-pages-rate
In function cpu_physical_memory_sync_dirty_bitmap, file
include/exec/ram_addr.h:

if (src[idx][offset]) {
    unsigned long bits = atomic_xchg(&src[idx][offset], 0);
    unsigned long new_dirty;
    new_dirty = ~dest[k];
    dest[k] |= bits;
    new_dirty &= bits;
    num_dirty += ctpopl(new_dirty);
}

After these codes executed, only the pages not dirtied in bitmap(dest),
but dirtied in dirty_memory[DIRTY_MEMORY_MIGRATION] will be calculated.
For example:
When ram_list.dirty_memory[DIRTY_MEMORY_MIGRATION] = 0b00001111,
and atomic_rcu_read(&migration_bitmap_rcu)->bmap = 0b00000011,
the new_dirty will be 0b00001100, and this function will return 2 but not
4 which is expected.
the dirty pages in dirty_memory[DIRTY_MEMORY_MIGRATION] are all new,
so these should be calculated also.

Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2017-03-16 08:55:56 +01:00
..
Makefile.objs build: remove --enable-colo/--disable-colo 2017-01-16 17:52:35 +01:00
block.c migration: Document handling of bdrv_is_allocated() errors 2017-03-13 12:49:33 +01:00
colo-comm.c COLO: Add 'x-colo-lost-heartbeat' command to trigger failover 2016-10-30 15:17:39 +05:30
colo-failover.c COLO: Implement the process of failover for primary VM 2016-10-30 15:17:39 +05:30
colo.c Add a new qmp command to do checkpoint, query xen replication status 2017-02-28 11:02:12 -08:00
exec.c migration: set name for all I/O channels created 2016-10-27 09:13:10 +02:00
fd.c migration: set name for all I/O channels created 2016-10-27 09:13:10 +02:00
migration.c postcopy: Record largest page size 2017-02-28 11:30:23 +00:00
postcopy-ram.c postcopy: Add extra check for COPY function 2017-02-28 11:30:24 +00:00
qemu-file-channel.c migration: introduce a new QEMUFile impl based on QIOChannel 2016-05-26 11:31:24 +05:30
qemu-file.c add 'release-ram' migrate capability 2017-02-13 17:27:13 +00:00
qjson.c qjson: free str 2016-08-08 00:00:24 +04:00
ram.c Change the method to calculate dirty-pages-rate 2017-03-16 08:55:56 +01:00
rdma.c migration/rdma: Don't flag an error when we've been told about one 2016-10-13 17:22:38 +02:00
savevm.c postcopy: Transmit ram size summary word 2017-02-28 11:30:23 +00:00
socket.c io: change the QIOTask callback signature 2017-01-23 15:32:18 +00:00
tls.c io: change the QIOTask callback signature 2017-01-23 15:32:18 +00:00
trace-events exec: ram_block_discard_range 2017-02-28 11:30:23 +00:00
vmstate.c migration/vmstate: fix array of ptr with nullptrs 2017-02-28 11:29:00 +00:00
xbzrle.c util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00