diff options
| author | Lukas Straub <lukasstraub2@web.de> | 2020-05-11 13:10:44 +0200 |
|---|---|---|
| committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2020-06-01 18:44:27 +0100 |
| commit | bb70b66ed7a5600a63437fb6d64dedb44f670e58 (patch) | |
| tree | dcac9bc50eb0326987316259efe0b8de4e210cd1 /migration/migration.h | |
| parent | e0d138aa9b3a4c72fe8bca735686132fdea646b7 (diff) | |
| download | focaccia-qemu-bb70b66ed7a5600a63437fb6d64dedb44f670e58.tar.gz focaccia-qemu-bb70b66ed7a5600a63437fb6d64dedb44f670e58.zip | |
migration/colo.c: Use event instead of semaphore
If multiple packets miscompare in a short timeframe, the semaphore value will be increased multiple times. This causes multiple checkpoints even if one would be sufficient. Fix this by using a event instead of a semaphore for triggering checkpoints. Now, checkpoint requests will be ignored until the checkpoint event is sent to colo-compare (which releases the miscompared packets). Benchmark results (iperf3): Client-to-server tcp: without patch: ~66 Mbit/s with patch: ~61 Mbit/s Server-to-client tcp: without patch: ~702 Kbit/s with patch: ~16 Mbit/s Signed-off-by: Lukas Straub <lukasstraub2@web.de> Message-Id: <fd601ba1beb524aada54ba66e87ebfc12cf4574b.1589193382.git.lukasstraub2@web.de> Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration/migration.h')
| -rw-r--r-- | migration/migration.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/migration/migration.h b/migration/migration.h index 507284e563..f617960522 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -215,8 +215,8 @@ struct MigrationState /* The semaphore is used to notify COLO thread that failover is finished */ QemuSemaphore colo_exit_sem; - /* The semaphore is used to notify COLO thread to do checkpoint */ - QemuSemaphore colo_checkpoint_sem; + /* The event is used to notify COLO thread to do checkpoint */ + QemuEvent colo_checkpoint_event; int64_t colo_checkpoint_time; QEMUTimer *colo_delay_timer; |