summaryrefslogtreecommitdiff
path: root/migration/block.c
diff options
context:
space:
mode:
authorLidong Chen <jemmy858585@gmail.com>2017-03-15 11:37:33 +0800
committerJuan Quintela <quintela@redhat.com>2017-03-16 08:58:27 +0100
commit1cf6aa74b32f18f9b5faf525a93b0c1f609acb1f (patch)
tree2dec61809940e38c6dee28f8aaf41122f80cbc18 /migration/block.c
parent4af245dc3e6e5c96405b3edb9d75657504256469 (diff)
downloadqemu-1cf6aa74b32f18f9b5faf525a93b0c1f609acb1f.zip
migration/block: Avoid invoking blk_drain too frequently
Increase bmds->cur_dirty after submit io, so reduce the frequency involve into blk_drain, and improve the performance obviously when block migration. The performance test result of this patch: During the block dirty save phase, this patch improve guest os IOPS from 4.0K to 9.5K. and improve the migration speed from 505856 rsec/s to 855756 rsec/s. Signed-off-by: Lidong Chen <jemmy858585@gmail.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/block.c')
-rw-r--r--migration/block.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/migration/block.c b/migration/block.c
index 6741228200..7734ff728a 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -576,6 +576,9 @@ static int mig_save_device_dirty(QEMUFile *f, BlkMigDevState *bmds,
}
bdrv_reset_dirty_bitmap(bmds->dirty_bitmap, sector, nr_sectors);
+ sector += nr_sectors;
+ bmds->cur_dirty = sector;
+
break;
}
sector += BDRV_SECTORS_PER_DIRTY_CHUNK;