From nobody Mon Feb 9 04:58:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1572006801; cv=none; d=zoho.com; s=zohoarc; b=iVxWClGas/duRsGFugQXCwEVIYJ6Cp8yYMejNFlSlUKswm62/MR3Xo4/MEUGQV/q1mqe3SnCqWhtTlUVe4RHUK7sx1VaBaM9Qx+Qa5fIcfyWBZLd4MzQWkZLNH3Wpag2+d7+acJK73Itnh/3Np+E/0yvHrl8B5fqs4c6Rq4/adk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572006801; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=0ndCbuoXggzDITfCRMynCmlmjj8dPfPxM5NvuYK+/ZY=; b=TXjxEliGxAjvHBDYJsLj0Etw+AnGNi/Ud81SpPMbmIHQgEGW0Rp1GFZGbnI+cSGy1rmjsDez/0giWtkWy8cqytTll6sND48Txrf3k6QH3ASA3ThLYhBp0nVB2xal0MW8lxU5vInCzoBmKqcMIy0zszC+skSiuMYz9vz5L+IfQ7w= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572006801373923.5488280528027; Fri, 25 Oct 2019 05:33:21 -0700 (PDT) Received: from localhost ([::1]:59378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNymN-0002hE-Dq for importer@patchew.org; Fri, 25 Oct 2019 08:33:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50785) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNycF-0000v2-W6 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 08:22:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNycE-0007ud-Hj for qemu-devel@nongnu.org; Fri, 25 Oct 2019 08:22:51 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:22569 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNycE-0007uX-Dx for qemu-devel@nongnu.org; Fri, 25 Oct 2019 08:22:50 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-358-eLh2A9rzMlKpnh4371n4SA-1; Fri, 25 Oct 2019 08:22:46 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4271B1800E00; Fri, 25 Oct 2019 12:22:45 +0000 (UTC) Received: from localhost (ovpn-117-215.ams2.redhat.com [10.36.117.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A10160BE0; Fri, 25 Oct 2019 12:22:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572006170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ndCbuoXggzDITfCRMynCmlmjj8dPfPxM5NvuYK+/ZY=; b=KSlIokNxR9QxbDj3SufmL3yqdhKHBBX3ilJMYZzGZY8b0xCFxXury4VWRvRJy/c08ADy2t kZhymZHImjHSONJBCchH6Z1DaeCV21xCEXgEkLvq7zsCYT3bidILeVlfz+zBrHT/LVtOHe h1jGDJ9m8JHjSOVOIqHrAI/EPHFLjfc= From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PATCH] iothread: document -object iothread on man page Date: Fri, 25 Oct 2019 14:22:36 +0200 Message-Id: <20191025122236.29815-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: eLh2A9rzMlKpnh4371n4SA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhenyu Ye , dgilbert@redhat.com, xiexiangyou@huawei.com, jiangyiwen , Stefan Hajnoczi , pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Stefan Hajnoczi --- 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=3Dlaptop.example.com,O=3DExample Home,L=3DLondon,ST=3DLondon,C=3DGB @end example =20 +@item -object iothread,id=3D@var{id},poll-max-ns=3D@var{poll-max-ns},poll-= grow=3D@var{poll-grow},poll-shrink=3D@var{poll-shrink} + +Creates a dedicated event loop thread that devices can be assigned to. Th= is 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 th= is +IOThread from @option{-device ...,iothread=3D@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 t= hread +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 parame= ters +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 po= lling +time when the algorithm detects it is missing events due to not polling lo= ng +enough. + +The @option{poll-shrink} parameter is the divisor used to decrease the pol= ling +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 =20 @end table =20 --=20 2.21.0