[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 30/30] migration: save/delete migration thread info
From: |
Juan Quintela |
Subject: |
[PULL 30/30] migration: save/delete migration thread info |
Date: |
Tue, 7 Feb 2023 01:56:50 +0100 |
From: Jiang Jiacheng <jiangjiacheng@huawei.com>
To support query migration thread infomation, save and delete
thread(live_migration and multifdsend) information at thread
creation and finish.
Signed-off-by: Jiang Jiacheng <jiangjiacheng@huawei.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/migration.c | 5 +++++
migration/multifd.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/migration/migration.c b/migration/migration.c
index 66c74f8e17..7a14aa98d8 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -58,6 +58,7 @@
#include "net/announce.h"
#include "qemu/queue.h"
#include "multifd.h"
+#include "threadinfo.h"
#include "qemu/yank.h"
#include "sysemu/cpus.h"
#include "yank_functions.h"
@@ -4028,10 +4029,13 @@ static void qemu_savevm_wait_unplug(MigrationState *s,
int old_state,
static void *migration_thread(void *opaque)
{
MigrationState *s = opaque;
+ MigrationThread *thread = NULL;
int64_t setup_start = qemu_clock_get_ms(QEMU_CLOCK_HOST);
MigThrError thr_error;
bool urgent = false;
+ thread = MigrationThreadAdd("live_migration", qemu_get_thread_id());
+
rcu_register_thread();
object_ref(OBJECT(s));
@@ -4108,6 +4112,7 @@ static void *migration_thread(void *opaque)
migration_iteration_finish(s);
object_unref(OBJECT(s));
rcu_unregister_thread();
+ MigrationThreadDel(thread);
return NULL;
}
diff --git a/migration/multifd.c b/migration/multifd.c
index 437bf6f808..b7ad7002e0 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -24,6 +24,7 @@
#include "qemu-file.h"
#include "trace.h"
#include "multifd.h"
+#include "threadinfo.h"
#include "qemu/yank.h"
#include "io/channel-socket.h"
@@ -649,10 +650,13 @@ int multifd_send_sync_main(QEMUFile *f)
static void *multifd_send_thread(void *opaque)
{
MultiFDSendParams *p = opaque;
+ MigrationThread *thread = NULL;
Error *local_err = NULL;
int ret = 0;
bool use_zero_copy_send = migrate_use_zero_copy_send();
+ thread = MigrationThreadAdd(p->name, qemu_get_thread_id());
+
trace_multifd_send_thread_start(p->id);
rcu_register_thread();
@@ -762,6 +766,7 @@ out:
qemu_mutex_unlock(&p->mutex);
rcu_unregister_thread();
+ MigrationThreadDel(thread);
trace_multifd_send_thread_end(p->id, p->num_packets,
p->total_normal_pages);
return NULL;
--
2.39.1
- [PULL 22/30] migration: Add canary to VMSTATE_END_OF_LIST, (continued)
- [PULL 22/30] migration: Add canary to VMSTATE_END_OF_LIST, Juan Quintela, 2023/02/06
- [PULL 23/30] migration: Perform vmsd structure check during tests, Juan Quintela, 2023/02/06
- [PULL 24/30] migration/dirtyrate: Show sample pages only in page-sampling mode, Juan Quintela, 2023/02/06
- [PULL 25/30] io: Add support for MSG_PEEK for socket channel, Juan Quintela, 2023/02/06
- [PULL 26/30] migration: check magic value for deciding the mapping of channels, Juan Quintela, 2023/02/06
- [PULL 27/30] multifd: Fix a race on reading MultiFDPages_t.block, Juan Quintela, 2023/02/06
- [PULL 28/30] multifd: Fix flush of zero copy page send request, Juan Quintela, 2023/02/06
- [PULL 29/30] migration: Introduce interface query-migrationthreads, Juan Quintela, 2023/02/06
- [PULL 30/30] migration: save/delete migration thread info,
Juan Quintela <=
- Re: [PULL 00/30] Migration 20230206 patches, Peter Maydell, 2023/02/07