Skip to content

Commit ebfc578

Browse files
duanzhenzhongJuan Quintela
authored and
Juan Quintela
committed
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 <[email protected]> Reviewed-by: Juan Quintela <[email protected]> Signed-off-by: Juan Quintela <[email protected]>
1 parent ddbe628 commit ebfc578

File tree

4 files changed

+1291
-4
lines changed

4 files changed

+1291
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Boards:
2+
#
3+
CONFIG_ISAPC=n
4+
CONFIG_I440FX=n
5+
CONFIG_Q35=n
6+
CONFIG_MICROVM=y
7+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Boards:
2+
#
3+
CONFIG_ISAPC=y
4+
CONFIG_I440FX=y
5+
CONFIG_Q35=y
6+
CONFIG_MICROVM=y

migration/multifd.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -630,16 +630,16 @@ int multifd_send_sync_main(QEMUFile *f)
630630
stat64_add(&ram_atomic_counters.transferred, p->packet_len);
631631
qemu_mutex_unlock(&p->mutex);
632632
qemu_sem_post(&p->sem);
633-
634-
if (flush_zero_copy && p->c && (multifd_zero_copy_flush(p->c) < 0)) {
635-
return -1;
636-
}
637633
}
638634
for (i = 0; i < migrate_multifd_channels(); i++) {
639635
MultiFDSendParams *p = &multifd_send_state->params[i];
640636

641637
trace_multifd_send_sync_main_wait(p->id);
642638
qemu_sem_wait(&p->sem_sync);
639+
640+
if (flush_zero_copy && p->c && (multifd_zero_copy_flush(p->c) < 0)) {
641+
return -1;
642+
}
643643
}
644644
trace_multifd_send_sync_main(multifd_send_state->packet_num);
645645

0 commit comments

Comments
 (0)