[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/40] migration: let incoming side use thread contex
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 13/40] migration: let incoming side use thread context |
Date: |
Wed, 16 May 2018 01:39:50 +0200 |
From: Peter Xu <address@hidden>
The old incoming migration is running in main thread and default
gcontext. With the new qio_channel_add_watch_full() we can now let it
run in the thread's own gcontext (if there is one).
Currently this patch does nothing alone. But when any of the incoming
migration is run in another iothread (e.g., the upcoming migrate-recover
command), this patch will bind the incoming logic to the iothread
instead of the main thread (which may already get page faulted and
hanged).
RDMA is not considered for now since it's not even using the QIO watch
framework at all.
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration/exec.c | 9 ++++-----
migration/fd.c | 9 ++++-----
migration/socket.c | 7 ++++---
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/migration/exec.c b/migration/exec.c
index 0bc5a427dd..9d0f82f1f0 100644
--- a/migration/exec.c
+++ b/migration/exec.c
@@ -65,9 +65,8 @@ void exec_start_incoming_migration(const char *command, Error
**errp)
}
qio_channel_set_name(ioc, "migration-exec-incoming");
- qio_channel_add_watch(ioc,
- G_IO_IN,
- exec_accept_incoming_migration,
- NULL,
- NULL);
+ qio_channel_add_watch_full(ioc, G_IO_IN,
+ exec_accept_incoming_migration,
+ NULL, NULL,
+ g_main_context_get_thread_default());
}
diff --git a/migration/fd.c b/migration/fd.c
index cd06182d1e..9a380bbbc4 100644
--- a/migration/fd.c
+++ b/migration/fd.c
@@ -66,9 +66,8 @@ void fd_start_incoming_migration(const char *infd, Error
**errp)
}
qio_channel_set_name(QIO_CHANNEL(ioc), "migration-fd-incoming");
- qio_channel_add_watch(ioc,
- G_IO_IN,
- fd_accept_incoming_migration,
- NULL,
- NULL);
+ qio_channel_add_watch_full(ioc, G_IO_IN,
+ fd_accept_incoming_migration,
+ NULL, NULL,
+ g_main_context_get_thread_default());
}
diff --git a/migration/socket.c b/migration/socket.c
index 7a5eb562b8..3456eb76e9 100644
--- a/migration/socket.c
+++ b/migration/socket.c
@@ -190,9 +190,10 @@ static void socket_start_incoming_migration(SocketAddress
*saddr,
return;
}
- qio_net_listener_set_client_func(listener,
- socket_accept_incoming_migration,
- NULL, NULL);
+ qio_net_listener_set_client_func_full(listener,
+ socket_accept_incoming_migration,
+ NULL, NULL,
+ g_main_context_get_thread_default());
}
void tcp_start_incoming_migration(const char *host_port, Error **errp)
--
2.17.0
- [Qemu-devel] [PULL 02/40] tests: Add migration precopy test, (continued)
- [Qemu-devel] [PULL 02/40] tests: Add migration precopy test, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 01/40] migration: fix saving normal page even if it's been compressed, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 03/40] tests: Migration ppc now inlines its program, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 05/40] migration: Introduce multifd_recv_new_channel(), Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 04/40] migration: Set error state in case of error, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 06/40] migration: terminate_* can be called for other threads, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 09/40] migration: Create multifd channels, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 08/40] migration: Export functions to create send channels, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 10/40] migration: Delay start of migration main routines, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 11/40] migration: Transmit initial package through the multifd channels, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 13/40] migration: let incoming side use thread context,
Juan Quintela <=
- [Qemu-devel] [PULL 12/40] migration: Define MultifdRecvParams sooner, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 07/40] migration: Be sure all recv channels are created, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 14/40] migration: new postcopy-pause state, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 16/40] migration: allow dst vm pause on postcopy, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 17/40] migration: allow src return path to pause, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 18/40] migration: allow fault thread to pause, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 19/40] qmp: hmp: add migrate "resume" option, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 15/40] migration: implement "postcopy-pause" src logic, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 20/40] migration: rebuild channel on source, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 22/40] migration: wakeup dst ram-load-thread for recover, Juan Quintela, 2018/05/15