* [RESEND PATCH 0/2] migration: Report migration related thread pid to libvirt to support migration pin
@ 2023-01-09 12:12 Jiang Jiacheng via
2023-01-09 12:12 ` [RESEND PATCH 1/2] migration: report migration related thread pid to libvirt Jiang Jiacheng via
2023-01-09 12:12 ` [RESEND PATCH 2/2] migration: report multiFd " Jiang Jiacheng via
0 siblings, 2 replies; 6+ messages in thread
From: Jiang Jiacheng via @ 2023-01-09 12:12 UTC (permalink / raw)
To: qemu-devel
Cc: quintela, dgilbert, yubihong, xiexiangyou, zhengchuan, linyilu,
jiangjiacheng
By default, the migration thread shares CPU resources with the VM process.
With migration pin, support pin migration thread to expected CPU list
to avoid preempting CPU resources of VM process.
To support migration pin, we need report migration related thread pid
to libvirt.
libvirt patches:
https://listman.redhat.com/archives/libvir-list/2023-January/236561.html
Zheng Chuan (2):
migration: report migration related thread pid to libvirt
migration: report multiFd related thread pid to libvirt
migration/migration.c | 3 +++
migration/multifd.c | 4 ++++
qapi/migration.json | 24 ++++++++++++++++++++++++
3 files changed, 31 insertions(+)
--
2.33.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RESEND PATCH 1/2] migration: report migration related thread pid to libvirt
2023-01-09 12:12 [RESEND PATCH 0/2] migration: Report migration related thread pid to libvirt to support migration pin Jiang Jiacheng via
@ 2023-01-09 12:12 ` Jiang Jiacheng via
2023-01-09 12:12 ` [RESEND PATCH 2/2] migration: report multiFd " Jiang Jiacheng via
1 sibling, 0 replies; 6+ messages in thread
From: Jiang Jiacheng via @ 2023-01-09 12:12 UTC (permalink / raw)
To: qemu-devel
Cc: quintela, dgilbert, yubihong, xiexiangyou, zhengchuan, linyilu,
jiangjiacheng
From: Zheng Chuan <zhengchuan@huawei.com>
Report migration thread pid to libvirt in order to pin
migration thread to different cpu.
---
migration/migration.c | 3 +++
qapi/migration.json | 12 ++++++++++++
2 files changed, 15 insertions(+)
diff --git a/migration/migration.c b/migration/migration.c
index 52b5d39244..2534e5a1f1 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3955,6 +3955,9 @@ static void *migration_thread(void *opaque)
MigThrError thr_error;
bool urgent = false;
+ /* report migration thread pid to libvirt */
+ qapi_event_send_migration_pid(qemu_get_thread_id());
+
rcu_register_thread();
object_ref(OBJECT(s));
diff --git a/qapi/migration.json b/qapi/migration.json
index 88ecf86ac8..aafc940617 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1286,6 +1286,18 @@
{ 'event': 'MIGRATION_PASS',
'data': { 'pass': 'int' } }
+##
+# @MIGRATION_PID:
+#
+# Emitted when migration thread appear
+#
+# @pid: pid of migration thread
+#
+# Since: 7.2
+##
+{ 'event': 'MIGRATION_PID',
+ 'data': { 'pid': 'int' } }
+
##
# @COLOMessage:
#
--
2.33.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RESEND PATCH 2/2] migration: report multiFd related thread pid to libvirt
2023-01-09 12:12 [RESEND PATCH 0/2] migration: Report migration related thread pid to libvirt to support migration pin Jiang Jiacheng via
2023-01-09 12:12 ` [RESEND PATCH 1/2] migration: report migration related thread pid to libvirt Jiang Jiacheng via
@ 2023-01-09 12:12 ` Jiang Jiacheng via
2023-01-11 19:00 ` Dr. David Alan Gilbert
1 sibling, 1 reply; 6+ messages in thread
From: Jiang Jiacheng via @ 2023-01-09 12:12 UTC (permalink / raw)
To: qemu-devel
Cc: quintela, dgilbert, yubihong, xiexiangyou, zhengchuan, linyilu,
jiangjiacheng
From: Zheng Chuan <zhengchuan@huawei.com>
Report multiFd related thread pid to libvirt in order to
pin multiFd thread to different cpu.
---
migration/multifd.c | 4 ++++
qapi/migration.json | 12 ++++++++++++
2 files changed, 16 insertions(+)
diff --git a/migration/multifd.c b/migration/multifd.c
index 000ca4d4ec..f3f7e8ae31 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -17,6 +17,7 @@
#include "exec/ramblock.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
+#include "qapi/qapi-events-migration.h"
#include "ram.h"
#include "migration.h"
#include "socket.h"
@@ -650,6 +651,9 @@ static void *multifd_send_thread(void *opaque)
int ret = 0;
bool use_zero_copy_send = migrate_use_zero_copy_send();
+ /* report multifd thread pid to libvirt */
+ qapi_event_send_migration_multifd_pid(qemu_get_thread_id());
+
trace_multifd_send_thread_start(p->id);
rcu_register_thread();
diff --git a/qapi/migration.json b/qapi/migration.json
index aafc940617..33fc319329 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1286,6 +1286,18 @@
{ 'event': 'MIGRATION_PASS',
'data': { 'pass': 'int' } }
+##
+# @MIGRATION_MULTIFD_PID:
+#
+# Emitted when multifd thread appear
+#
+# @pid: pid of multifd thread
+#
+# Since: 7.2
+##
+{ 'event': 'MIGRATION_MULTIFD_PID',
+ 'data': { 'pid': 'int' } }
+
##
# @MIGRATION_PID:
#
--
2.33.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH 2/2] migration: report multiFd related thread pid to libvirt
2023-01-09 12:12 ` [RESEND PATCH 2/2] migration: report multiFd " Jiang Jiacheng via
@ 2023-01-11 19:00 ` Dr. David Alan Gilbert
2023-01-11 19:04 ` Daniel P. Berrangé
0 siblings, 1 reply; 6+ messages in thread
From: Dr. David Alan Gilbert @ 2023-01-11 19:00 UTC (permalink / raw)
To: Jiang Jiacheng, jdenemar, berrange
Cc: qemu-devel, quintela, yubihong, xiexiangyou, zhengchuan, linyilu
* Jiang Jiacheng via (qemu-devel@nongnu.org) wrote:
> From: Zheng Chuan <zhengchuan@huawei.com>
>
> Report multiFd related thread pid to libvirt in order to
> pin multiFd thread to different cpu.
With multifd you may well want to pin different multifd threads
to different cores; so you need to include the 'id' and 'name' fields of
the multifd thread in the event.
(Copying in Jiri and Dan )
Dave
> ---
> migration/multifd.c | 4 ++++
> qapi/migration.json | 12 ++++++++++++
> 2 files changed, 16 insertions(+)
>
> diff --git a/migration/multifd.c b/migration/multifd.c
> index 000ca4d4ec..f3f7e8ae31 100644
> --- a/migration/multifd.c
> +++ b/migration/multifd.c
> @@ -17,6 +17,7 @@
> #include "exec/ramblock.h"
> #include "qemu/error-report.h"
> #include "qapi/error.h"
> +#include "qapi/qapi-events-migration.h"
> #include "ram.h"
> #include "migration.h"
> #include "socket.h"
> @@ -650,6 +651,9 @@ static void *multifd_send_thread(void *opaque)
> int ret = 0;
> bool use_zero_copy_send = migrate_use_zero_copy_send();
>
> + /* report multifd thread pid to libvirt */
> + qapi_event_send_migration_multifd_pid(qemu_get_thread_id());
> +
> trace_multifd_send_thread_start(p->id);
> rcu_register_thread();
>
> diff --git a/qapi/migration.json b/qapi/migration.json
> index aafc940617..33fc319329 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -1286,6 +1286,18 @@
> { 'event': 'MIGRATION_PASS',
> 'data': { 'pass': 'int' } }
>
> +##
> +# @MIGRATION_MULTIFD_PID:
> +#
> +# Emitted when multifd thread appear
> +#
> +# @pid: pid of multifd thread
> +#
> +# Since: 7.2
> +##
> +{ 'event': 'MIGRATION_MULTIFD_PID',
> + 'data': { 'pid': 'int' } }
> +
> ##
> # @MIGRATION_PID:
> #
> --
> 2.33.0
>
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH 2/2] migration: report multiFd related thread pid to libvirt
2023-01-11 19:00 ` Dr. David Alan Gilbert
@ 2023-01-11 19:04 ` Daniel P. Berrangé
2023-01-12 9:24 ` Jiang Jiacheng via
0 siblings, 1 reply; 6+ messages in thread
From: Daniel P. Berrangé @ 2023-01-11 19:04 UTC (permalink / raw)
To: Dr. David Alan Gilbert
Cc: Jiang Jiacheng, jdenemar, qemu-devel, quintela, yubihong,
xiexiangyou, zhengchuan, linyilu
On Wed, Jan 11, 2023 at 07:00:53PM +0000, Dr. David Alan Gilbert wrote:
> * Jiang Jiacheng via (qemu-devel@nongnu.org) wrote:
> > From: Zheng Chuan <zhengchuan@huawei.com>
> >
> > Report multiFd related thread pid to libvirt in order to
> > pin multiFd thread to different cpu.
>
> With multifd you may well want to pin different multifd threads
> to different cores; so you need to include the 'id' and 'name' fields of
> the multifd thread in the event.
Are the 'id' / 'name' fields considered stable API for QEMU ?
IIRC, the mgmt app merely requests the number of multifd threads
and doesn't assign any identifying names/ids to them, unlike
iothreads where the mgmt app gives an explicit 'id'.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH 2/2] migration: report multiFd related thread pid to libvirt
2023-01-11 19:04 ` Daniel P. Berrangé
@ 2023-01-12 9:24 ` Jiang Jiacheng via
0 siblings, 0 replies; 6+ messages in thread
From: Jiang Jiacheng via @ 2023-01-12 9:24 UTC (permalink / raw)
To: Daniel P. Berrangé, Dr. David Alan Gilbert
Cc: jdenemar, qemu-devel, quintela, yubihong, xiexiangyou, zhengchuan,
linyilu
On 2023/1/12 3:04, Daniel P. Berrangé wrote:
> On Wed, Jan 11, 2023 at 07:00:53PM +0000, Dr. David Alan Gilbert wrote:
>> * Jiang Jiacheng via (qemu-devel@nongnu.org) wrote:
>>> From: Zheng Chuan <zhengchuan@huawei.com>
>>>
>>> Report multiFd related thread pid to libvirt in order to
>>> pin multiFd thread to different cpu.
>>
>> With multifd you may well want to pin different multifd threads
>> to different cores; so you need to include the 'id' and 'name' fields of
>> the multifd thread in the event.
>
> Are the 'id' / 'name' fields considered stable API for QEMU ?
>
> IIRC, the mgmt app merely requests the number of multifd threads
> and doesn't assign any identifying names/ids to them, unlike
> iothreads where the mgmt app gives an explicit 'id'.
>
>
If the 'id'/'name' of the migration thread is fixed in QEMU API, I think
the related information can be added to the mgmt app to implement
migration thread pin more properly.
And we are considering another choice, which provides a list of
migration thread information for the mgmt app to actively query, so as
to provide more information and avoid exposing thread PIDs to the mgmt
app's public API.
Thanks
Jiang Jiacheng
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-01-12 9:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-09 12:12 [RESEND PATCH 0/2] migration: Report migration related thread pid to libvirt to support migration pin Jiang Jiacheng via
2023-01-09 12:12 ` [RESEND PATCH 1/2] migration: report migration related thread pid to libvirt Jiang Jiacheng via
2023-01-09 12:12 ` [RESEND PATCH 2/2] migration: report multiFd " Jiang Jiacheng via
2023-01-11 19:00 ` Dr. David Alan Gilbert
2023-01-11 19:04 ` Daniel P. Berrangé
2023-01-12 9:24 ` Jiang Jiacheng via
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).