migration/colo.c: Use event instead of semaphore
commitbb70b66ed7a5600a63437fb6d64dedb44f670e58
authorLukas Straub <lukasstraub2@web.de>
Mon, 11 May 2020 11:10:44 +0000 (11 13:10 +0200)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 1 Jun 2020 17:44:27 +0000 (1 18:44 +0100)
treedcac9bc50eb0326987316259efe0b8de4e210cd1
parente0d138aa9b3a4c72fe8bca735686132fdea646b7
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>
migration/colo.c
migration/migration.h