diff options
author | Keqian Zhu <zhukeqian1@huawei.com> | 2020-06-22 11:20:37 +0800 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2020-07-03 16:23:05 +0100 |
commit | fb6135807fcab4670d69663ac88e88e124348ffd (patch) | |
tree | c6efa8ee3ca8d2c30759ac43426d18f4f6510e15 /migration | |
parent | 617a32f5295ee4efcc17abadcecc3cf482c98e80 (diff) | |
download | qemu-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 'migration')
-rw-r--r-- | migration/ram.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/migration/ram.c b/migration/ram.c index 069b6e3..5554a7d 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -859,9 +859,11 @@ static inline bool migration_bitmap_clear_dirty(RAMState *rs, /* Called with RCU critical section */ static void ramblock_sync_dirty_bitmap(RAMState *rs, RAMBlock *rb) { - rs->migration_dirty_pages += - cpu_physical_memory_sync_dirty_bitmap(rb, 0, rb->used_length, - &rs->num_dirty_pages_period); + uint64_t new_dirty_pages = + cpu_physical_memory_sync_dirty_bitmap(rb, 0, rb->used_length); + + rs->migration_dirty_pages += new_dirty_pages; + rs->num_dirty_pages_period += new_dirty_pages; } /** |