Files
qemu-qemu/migration/multifd-colo.h
Lukas Straub dd67c149e2 multifd: Add COLO support
Like in the normal ram_load() path, put the received pages into the
colo cache and mark the pages in the bitmap so that they will be
flushed to the guest later.

Multifd with COLO is useful to reduce the VM pause time during checkpointing
for latency sensitive workloads. In such workloads the worst-case latency
is especially important.

Also, this is already worth it for the precopy phase as it helps with
converging. Moreover, multifd migration is the preferred way to do migration
nowadays and this allows to use multifd compression with COLO.

Benchmark:
Cluster nodes
 - Intel Xenon E5-2630 v3
 - 48Gb RAM
 - 10G Ethernet
Guest
 - Windows Server 2016
 - 6Gb RAM
 - 4 cores
Workload
 - Upload a file to the guest with SMB to simulate moderate
   memory dirtying
 - Measure the memory transfer time portion of each checkpoint
 - 600ms COLO checkpoint interval

Results
Plain
 idle mean: 4.50ms 99per: 10.33ms
 load mean: 24.30ms 99per: 78.05ms
Multifd-4
 idle mean: 6.48ms 99per: 10.41ms
 load mean: 14.12ms 99per: 31.27ms

Evaluation
While multifd has slightly higher latency when the guest idles, it is
10ms faster under load and more importantly it's worst case latency is
less than 1/2 of plain under load as can be seen in the 99. Percentile.

Co-authored-by: Juan Quintela <quintela@redhat.com>
[farosas: changed SoB to coauthored as Juan doesn't own that email address anymore]
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v11-8-d653fb3b1d80@web.de
[removed license boilerplate]
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2026-03-09 08:53:32 -03:00

24 lines
509 B
C

/*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* multifd colo header
*
* Copyright (c) Lukas Straub <lukasstraub2@web.de>
*/
#ifndef QEMU_MIGRATION_MULTIFD_COLO_H
#define QEMU_MIGRATION_MULTIFD_COLO_H
#ifdef CONFIG_REPLICATION
void multifd_colo_prepare_recv(MultiFDRecvParams *p);
void multifd_colo_process_recv(MultiFDRecvParams *p);
#else
static inline void multifd_colo_prepare_recv(MultiFDRecvParams *p) {}
static inline void multifd_colo_process_recv(MultiFDRecvParams *p) {}
#endif
#endif