]> git.proxmox.com Git - mirror_qemu.git/commit - memory.c
memory: include DIRTY_MEMORY_MIGRATION in the dirty log mask
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 23 Mar 2015 09:57:21 +0000 (10:57 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 5 Jun 2015 15:09:59 +0000 (17:09 +0200)
commit6f6a5ef3e429f92f987678ea8c396aab4dc6aa19
tree0fb7cdd721ee6c7274b266f5e6398f43250a7413
parentea8cb1a8d98f5e3822a23a7cecdb4add0f29178b
memory: include DIRTY_MEMORY_MIGRATION in the dirty log mask

The separate handling of DIRTY_MEMORY_MIGRATION, which does not
call log_start/log_stop callbacks when it changes in a region's
dirty logging mask, has caused several bugs.

One recent example is commit 4cc856f (kvm-all: Sync dirty-bitmap from
kvm before kvm destroy the corresponding dirty_bitmap, 2015-04-02).
Another performance problem is that KVM keeps tracking dirty pages
after a failed live migration, which causes bad performance due to
disallowing huge page mapping.

This patch removes the root cause of the problem by reporting
DIRTY_MEMORY_MIGRATION changes via log_start and log_stop.
Note that we now have to rebuild the FlatView when global dirty
logging is enabled or disabled; this ensures that log_start and
log_stop callbacks are invoked.

This will also be used to make the setting of bitmaps conditional.
In general, this patch lets users of the memory API ignore the
global state of dirty logging if they handle dirty logging
generically per region.

Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
memory.c