migration: Update atomic stats out of the mutex

Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
Juan Quintela 2022-11-24 17:26:19 +01:00
parent abce5fa16d
commit 30fb22cda4

View File

@ -433,8 +433,8 @@ static int multifd_send_pages(QEMUFile *f)
transferred = ((uint64_t) pages->num) * p->page_size + p->packet_len;
qemu_file_acct_rate_limit(f, transferred);
ram_counters.multifd_bytes += transferred;
stat64_add(&ram_counters.transferred, transferred);
qemu_mutex_unlock(&p->mutex);
stat64_add(&ram_counters.transferred, transferred);
qemu_sem_post(&p->sem);
return 1;
@ -628,8 +628,8 @@ int multifd_send_sync_main(QEMUFile *f)
p->pending_job++;
qemu_file_acct_rate_limit(f, p->packet_len);
ram_counters.multifd_bytes += p->packet_len;
stat64_add(&ram_counters.transferred, p->packet_len);
qemu_mutex_unlock(&p->mutex);
stat64_add(&ram_counters.transferred, p->packet_len);
qemu_sem_post(&p->sem);
}
for (i = 0; i < migrate_multifd_channels(); i++) {