qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iothread: document -object iothread on man page
@ 2019-10-25 12:22 Stefan Hajnoczi
  2019-11-05 16:03 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Hajnoczi @ 2019-10-25 12:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: Zhenyu Ye, dgilbert, xiexiangyou, jiangyiwen, Stefan Hajnoczi, pbonzini

Add -object iothread documentation to the man page, including references
to the query-iothread QMP command and qom-set syntax for adjusting
adaptive polling parameters at run-time.

Reported-by: Zhenyu Ye <yezhenyu2@huawei.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 qemu-options.hx | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/qemu-options.hx b/qemu-options.hx
index 996b6fba74..23d2b75b54 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4872,6 +4872,44 @@ access
 CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB
 @end example
 
+@item -object iothread,id=@var{id},poll-max-ns=@var{poll-max-ns},poll-grow=@var{poll-grow},poll-shrink=@var{poll-shrink}
+
+Creates a dedicated event loop thread that devices can be assigned to.  This is
+known as an IOThread.  By default device emulation happens in vCPU threads or
+the main event loop thread.  This can become a scalability bottleneck.
+IOThreads allow device emulation and I/O to run on other host CPUs.
+
+The @option{id} parameter is a unique ID that will be used to reference this
+IOThread from @option{-device ...,iothread=@var{id}}.  Multiple devices can be
+assigned to an IOThread.  Note that not all devices support an
+@option{iothread} parameter.
+
+The @code{query-iothreads} QMP command lists IOThreads and reports their thread
+IDs so that the user can configure host CPU pinning/affinity.
+
+IOThreads use an adaptive polling algorithm to reduce event loop latency.
+Instead of entering a blocking system call to monitor file descriptors and then
+pay the cost of being woken up when an event occurs, the polling algorithm
+spins waiting for events for a short time.  The algorithm's default parameters
+are suitable for many cases but can be adjusted based on knowledge of the
+workload and/or host device latency.
+
+The @option{poll-max-ns} parameter is the maximum number of nanoseconds to busy
+wait for events.  Polling can be disabled by setting this value to 0.
+
+The @option{poll-grow} parameter is the multiplier used to increase the polling
+time when the algorithm detects it is missing events due to not polling long
+enough.
+
+The @option{poll-shrink} parameter is the divisor used to decrease the polling
+time when the algorithm detects it is spending too long polling without
+encountering events.
+
+The polling parameters can be modified at run-time using the @code{qom-set} command (where @code{iothread1} is the IOThread's @code{id}):
+
+@example
+(qemu) qom-set /objects/iothread1 poll-max-ns 100000
+@end example
 
 @end table
 
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iothread: document -object iothread on man page
  2019-10-25 12:22 [PATCH] iothread: document -object iothread on man page Stefan Hajnoczi
@ 2019-11-05 16:03 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2019-11-05 16:03 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Zhenyu Ye, qemu-devel, xiexiangyou, dgilbert, jiangyiwen, pbonzini

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

On Fri, Oct 25, 2019 at 02:22:36PM +0200, Stefan Hajnoczi wrote:
> Add -object iothread documentation to the man page, including references
> to the query-iothread QMP command and qom-set syntax for adjusting
> adaptive polling parameters at run-time.
> 
> Reported-by: Zhenyu Ye <yezhenyu2@huawei.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  qemu-options.hx | 38 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)

Thanks, applied to my block-next tree for QEMU 4.3:
https://github.com/stefanha/qemu/commits/block-next

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-05 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-25 12:22 [PATCH] iothread: document -object iothread on man page Stefan Hajnoczi
2019-11-05 16:03 ` Stefan Hajnoczi

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).