multifd: Fix flush of zero copy page send request

Make IO channel flush call after the inflight request has been drained
in multifd thread, or else we may missed to flush the inflight request.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
Zhenzhong Duan 2022-10-17 15:53:51 +08:00 committed by Juan Quintela
parent ddbe628c97
commit ebfc578715
4 changed files with 1291 additions and 4 deletions

View File

@ -0,0 +1,7 @@
# Boards:
#
CONFIG_ISAPC=n
CONFIG_I440FX=n
CONFIG_Q35=n
CONFIG_MICROVM=y

View File

@ -0,0 +1,6 @@
# Boards:
#
CONFIG_ISAPC=y
CONFIG_I440FX=y
CONFIG_Q35=y
CONFIG_MICROVM=y

View File

@ -630,16 +630,16 @@ int multifd_send_sync_main(QEMUFile *f)
stat64_add(&ram_atomic_counters.transferred, p->packet_len);
qemu_mutex_unlock(&p->mutex);
qemu_sem_post(&p->sem);
if (flush_zero_copy && p->c && (multifd_zero_copy_flush(p->c) < 0)) {
return -1;
}
}
for (i = 0; i < migrate_multifd_channels(); i++) {
MultiFDSendParams *p = &multifd_send_state->params[i];
trace_multifd_send_sync_main_wait(p->id);
qemu_sem_wait(&p->sem_sync);
if (flush_zero_copy && p->c && (multifd_zero_copy_flush(p->c) < 0)) {
return -1;
}
}
trace_multifd_send_sync_main(multifd_send_state->packet_num);

1274
migration/multifd.c.orig Normal file

File diff suppressed because it is too large Load Diff