[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/34] migration/multifd: Move trace_multifd_send|recv()
From: |
peterx |
Subject: |
[PULL 12/34] migration/multifd: Move trace_multifd_send|recv() |
Date: |
Thu, 8 Feb 2024 11:05:06 +0800 |
From: Peter Xu <peterx@redhat.com>
Move them into fill/unfill of packets. With that, we can further cleanup
the send/recv thread procedure, and remove one more temp var.
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: 20240202102857.110210-12-peterx@redhat.com">https://lore.kernel.org/r/20240202102857.110210-12-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/multifd.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/migration/multifd.c b/migration/multifd.c
index 94a0124934..44163e4e28 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -291,6 +291,9 @@ static void multifd_send_fill_packet(MultiFDSendParams *p)
p->packets_sent++;
p->total_normal_pages += pages->num;
+
+ trace_multifd_send(p->id, p->packet_num, pages->num, p->flags,
+ p->next_packet_size);
}
static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
@@ -341,6 +344,9 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p,
Error **errp)
p->packets_recved++;
p->total_normal_pages += p->normal_num;
+ trace_multifd_recv(p->id, p->packet_num, p->normal_num, p->flags,
+ p->next_packet_size);
+
if (p->normal_num == 0) {
return 0;
}
@@ -704,7 +710,6 @@ static void *multifd_send_thread(void *opaque)
qemu_mutex_lock(&p->mutex);
if (qatomic_read(&p->pending_job)) {
- uint64_t packet_num = p->packet_num;
MultiFDPages_t *pages = p->pages;
if (use_zero_copy_send) {
@@ -722,8 +727,6 @@ static void *multifd_send_thread(void *opaque)
}
multifd_send_fill_packet(p);
- trace_multifd_send(p->id, packet_num, pages->num, p->flags,
- p->next_packet_size);
if (use_zero_copy_send) {
/* Send header first, without zerocopy */
@@ -1123,8 +1126,6 @@ static void *multifd_recv_thread(void *opaque)
flags = p->flags;
/* recv methods don't know how to handle the SYNC flag */
p->flags &= ~MULTIFD_FLAG_SYNC;
- trace_multifd_recv(p->id, p->packet_num, p->normal_num, flags,
- p->next_packet_size);
qemu_mutex_unlock(&p->mutex);
if (p->normal_num) {
--
2.43.0
- [PULL 06/34] migration/multifd: Drop MultiFDSendParams.normal[] array, (continued)
- [PULL 06/34] migration/multifd: Drop MultiFDSendParams.normal[] array, peterx, 2024/02/07
- [PULL 07/34] migration/multifd: Separate SYNC request with normal jobs, peterx, 2024/02/07
- [PULL 04/34] migration/multifd: Drop MultiFDSendParams.quit, cleanup error paths, peterx, 2024/02/07
- [PULL 08/34] migration/multifd: Simplify locking in sender thread, peterx, 2024/02/07
- [PULL 09/34] migration/multifd: Drop pages->num check in sender thread, peterx, 2024/02/07
- [PULL 13/34] migration/multifd: multifd_send_prepare_header(), peterx, 2024/02/07
- [PULL 10/34] migration/multifd: Rename p->num_packets and clean it up, peterx, 2024/02/07
- [PULL 20/34] migration/multifd: Cleanup multifd_save_cleanup(), peterx, 2024/02/07
- [PULL 21/34] migration/multifd: Cleanup multifd_load_cleanup(), peterx, 2024/02/07
- [PULL 11/34] migration/multifd: Move total_normal_pages accounting, peterx, 2024/02/07
- [PULL 12/34] migration/multifd: Move trace_multifd_send|recv(),
peterx <=
- [PULL 14/34] migration/multifd: Move header prepare/fill into send_prepare(), peterx, 2024/02/07
- [PULL 15/34] migration/multifd: Forbid spurious wakeups, peterx, 2024/02/07
- [PULL 17/34] migration/multifd: Change retval of multifd_queue_page(), peterx, 2024/02/07
- [PULL 19/34] migration/multifd: Rewrite multifd_queue_page(), peterx, 2024/02/07
- [PULL 22/34] migration/multifd: Stick with send/recv on function names, peterx, 2024/02/07
- [PULL 25/34] migration: Fix logic of channels and transport compatibility check, peterx, 2024/02/07
- [PULL 24/34] migration/multifd: Optimize sender side to be lockless, peterx, 2024/02/07
- [PULL 23/34] migration/multifd: Fix MultiFDSendParams.packet_num race, peterx, 2024/02/07
- [PULL 26/34] migration/multifd: Join the TLS thread, peterx, 2024/02/07