aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKeqian Zhu <zhukeqian1@huawei.com>2020-06-22 11:20:37 +0800
committerDr. David Alan Gilbert <dgilbert@redhat.com>2020-07-03 16:23:05 +0100
commitfb6135807fcab4670d69663ac88e88e124348ffd (patch)
treec6efa8ee3ca8d2c30759ac43426d18f4f6510e15 /include
parent617a32f5295ee4efcc17abadcecc3cf482c98e80 (diff)
downloadqemu-fb6135807fcab4670d69663ac88e88e124348ffd.zip
qemu-fb6135807fcab4670d69663ac88e88e124348ffd.tar.gz
qemu-fb6135807fcab4670d69663ac88e88e124348ffd.tar.bz2
migration: Count new_dirty instead of real_dirty
real_dirty_pages becomes equal to total ram size after dirty log sync in ram_init_bitmaps, the reason is that the bitmap of ramblock is initialized to be all set, so old path counts them as "real dirty" at beginning. This causes wrong dirty rate and false positive throttling. Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com> Message-Id: <20200622032037.31112-1-zhukeqian1@huawei.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/exec/ram_addr.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index 7b5c24e..3ef729a 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -442,8 +442,7 @@ static inline void cpu_physical_memory_clear_dirty_range(ram_addr_t start,
static inline
uint64_t cpu_physical_memory_sync_dirty_bitmap(RAMBlock *rb,
ram_addr_t start,
- ram_addr_t length,
- uint64_t *real_dirty_pages)
+ ram_addr_t length)
{
ram_addr_t addr;
unsigned long word = BIT_WORD((start + rb->offset) >> TARGET_PAGE_BITS);
@@ -469,7 +468,6 @@ uint64_t cpu_physical_memory_sync_dirty_bitmap(RAMBlock *rb,
if (src[idx][offset]) {
unsigned long bits = atomic_xchg(&src[idx][offset], 0);
unsigned long new_dirty;
- *real_dirty_pages += ctpopl(bits);
new_dirty = ~dest[k];
dest[k] |= bits;
new_dirty &= bits;
@@ -502,7 +500,6 @@ uint64_t cpu_physical_memory_sync_dirty_bitmap(RAMBlock *rb,
start + addr + offset,
TARGET_PAGE_SIZE,
DIRTY_MEMORY_MIGRATION)) {
- *real_dirty_pages += 1;
long k = (start + addr) >> TARGET_PAGE_BITS;
if (!test_and_set_bit(k, dest)) {
num_dirty++;