Skip to content

Commit

Permalink
migration/multifd: Move total_normal_pages accounting
Browse files Browse the repository at this point in the history
Just like the previous patch, move the accounting for total_normal_pages on
both src/dst sides into the packet fill/unfill procedures.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240202102857.110210-11-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
  • Loading branch information
xzpeter committed Feb 5, 2024
1 parent 05b7ec1 commit db7e1cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions migration/multifd.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ static void multifd_send_fill_packet(MultiFDSendParams *p)
}

p->packets_sent++;
p->total_normal_pages += pages->num;
}

static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
Expand Down Expand Up @@ -338,6 +339,7 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
p->next_packet_size = be32_to_cpu(packet->next_packet_size);
p->packet_num = be64_to_cpu(packet->packet_num);
p->packets_recved++;
p->total_normal_pages += p->normal_num;

if (p->normal_num == 0) {
return 0;
Expand Down Expand Up @@ -720,7 +722,6 @@ static void *multifd_send_thread(void *opaque)
}

multifd_send_fill_packet(p);
p->total_normal_pages += pages->num;
trace_multifd_send(p->id, packet_num, pages->num, p->flags,
p->next_packet_size);

Expand Down Expand Up @@ -1124,7 +1125,6 @@ static void *multifd_recv_thread(void *opaque)
p->flags &= ~MULTIFD_FLAG_SYNC;
trace_multifd_recv(p->id, p->packet_num, p->normal_num, flags,
p->next_packet_size);
p->total_normal_pages += p->normal_num;
qemu_mutex_unlock(&p->mutex);

if (p->normal_num) {
Expand Down

0 comments on commit db7e1cc

Please sign in to comment.