Skip to content

Commit

Permalink
multifd: Fix flush of zero copy page send request
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
duanzhenzhong authored and Juan Quintela committed Feb 6, 2023
1 parent ddbe628 commit ebfc578
Show file tree
Hide file tree
Showing 4 changed files with 1,291 additions and 4 deletions.
7 changes: 7 additions & 0 deletions configs/devices/x86_64-softmmu/x86_64-quintela-devices.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Boards:
#
CONFIG_ISAPC=n
CONFIG_I440FX=n
CONFIG_Q35=n
CONFIG_MICROVM=y

6 changes: 6 additions & 0 deletions configs/devices/x86_64-softmmu/x86_64-quintela2-devices.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Boards:
#
CONFIG_ISAPC=y
CONFIG_I440FX=y
CONFIG_Q35=y
CONFIG_MICROVM=y
8 changes: 4 additions & 4 deletions migration/multifd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading

0 comments on commit ebfc578

Please sign in to comment.