From nobody Sat Feb 7 13:02:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1654867557; cv=none; d=zohomail.com; s=zohoarc; b=T5WmRNAD8wJFhUv23fqaUPSl2nHCYEaxkmBzb2iAqdJTomHcfMlnwkt6cAb+yLe8QZiTakEu8GLUjldmKx58vmPTOuVzZNDFNKyyJwP40LKvguN2a3bw6PKHEYGN9rG+h9C9bQoYNToUaOvKmrJX8EsMv3Zi4ErqvtoWWW6jB9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654867557; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Y5eZkF3RxDCW0zoUSKT6DznIfh++V3FI5I6i8qCMh2A=; b=jVPApETzeGUuHC4Nohc8y5PqQwMBiAt2lKJF+h3q9GBnUgVIAmAmdbrXhG5OZZrJXXNzg99AZ8x0Sdw7m+pX1h/kqNiFaAly9ww86EhSQPvTABfi4+AGaixZ6XOsHarkBUN6G7yUWZvi/VDUGKVJcyzit5nJFFZNOsahvu+xM2Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1654867557624454.42280778356076; Fri, 10 Jun 2022 06:25:57 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-90-Uoc_inCGMHKXiYPo635Xdg-1; Fri, 10 Jun 2022 09:25:54 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 41E22397968E; Fri, 10 Jun 2022 13:25:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3645492C3B; Fri, 10 Jun 2022 13:25:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A1208194704C; Fri, 10 Jun 2022 13:25:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D369719466DF for ; Fri, 10 Jun 2022 13:25:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C24661410DDB; Fri, 10 Jun 2022 13:25:47 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43A281415100 for ; Fri, 10 Jun 2022 13:25:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654867556; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Y5eZkF3RxDCW0zoUSKT6DznIfh++V3FI5I6i8qCMh2A=; b=G4zpfKXbZy+yNcZkLe8OcmGc94W8AxEVPWSt3bVlp23lw6jxXd/UnPIhO6DycVb1+I/0MK t5au9KWr1WqhCAoKLNa89uUqjf9D3E/nliw6vaZRhGAqAmWcRcgUGMBB8GGwZOSDqzk0Gv HMsWXfCs/ub8OHg/OmRh8C8TBrigorQ= X-MC-Unique: Uoc_inCGMHKXiYPo635Xdg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] conf: virtiofs: add thread_pool element Date: Fri, 10 Jun 2022 15:25:43 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1654867558460100001 Add an element to configure the thread pool size: ... ... https://bugzilla.redhat.com/show_bug.cgi?id=3D2072905 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- docs/formatdomain.rst | 6 ++++++ src/conf/domain_conf.c | 14 ++++++++++++++ src/conf/domain_conf.h | 1 + src/conf/schemas/domaincommon.rng | 9 +++++++++ tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml | 1 + 5 files changed, 31 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 7da625380c..e8bff7632a 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3329,6 +3329,7 @@ A directory on the host that can be accessed directly= from the guest. + @@ -3462,6 +3463,11 @@ A directory on the host that can be accessed directl= y from the guest. ``chroot``, see the `virtiofsd documentation `__ for more details. ( :since:`Since 7.2.0` ) + Element ``thread_pool`` accepts one attribute ``size`` which defines the + maximum thread pool size. A value of "0" disables the pool. + The thread pool helps increase the number of requests in flight when us= ed with + storage that has a higher latency. However, it has an overhead, and so= for + fast, low latency filesystems, it may be best to turn it off. ( :since:= `Since 8.5.0` ) ``source`` The resource on the host that is being accessed in the guest. The ``nam= e`` attribute must be used with ``type=3D'template'``, and the ``dir`` attr= ibute diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 761c3f4d87..05fac7b39c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2476,6 +2476,8 @@ virDomainFSDefNew(virDomainXMLOption *xmlopt) =20 ret->src =3D virStorageSourceNew(); =20 + ret->thread_pool_size =3D -1; + if (xmlopt && xmlopt->privateData.fsNew && !(ret->privateData =3D xmlopt->privateData.fsNew())) @@ -9914,6 +9916,7 @@ virDomainFSDefParseXML(virDomainXMLOption *xmlopt, if (def->fsdriver =3D=3D VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS) { g_autofree char *queue_size =3D virXPathString("string(./driver/@q= ueue)", ctxt); g_autofree char *binary =3D virXPathString("string(./binary/@path)= ", ctxt); + g_autofree char *thread_pool_size =3D virXPathString("string(./bin= ary/thread_pool/@size)", ctxt); xmlNodePtr binary_node =3D virXPathNode("./binary", ctxt); xmlNodePtr binary_lock_node =3D virXPathNode("./binary/lock", ctxt= ); xmlNodePtr binary_cache_node =3D virXPathNode("./binary/cache", ct= xt); @@ -9926,6 +9929,13 @@ virDomainFSDefParseXML(virDomainXMLOption *xmlopt, goto error; } =20 + if (thread_pool_size && virStrToLong_i(thread_pool_size, NULL, 10,= &def->thread_pool_size) < 0) { + virReportError(VIR_ERR_XML_ERROR, + _("cannot parse thread pool size '%s' for virti= ofs"), + queue_size); + goto error; + } + if (binary) def->binary =3D virFileSanitizePath(binary); =20 @@ -24211,6 +24221,10 @@ virDomainFSDefFormat(virBuffer *buf, } =20 virXMLFormatElement(&binaryBuf, "lock", &lockAttrBuf, NULL); + + if (def->thread_pool_size >=3D 0) + virBufferAsprintf(&binaryBuf, "\n", = def->thread_pool_size); + } =20 virDomainVirtioOptionsFormat(&driverAttrBuf, def->virtio); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index da9e281214..8e0ccff543 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -906,6 +906,7 @@ struct _virDomainFSDef { virTristateSwitch posix_lock; virTristateSwitch flock; virDomainFSSandboxMode sandbox; + int thread_pool_size; virDomainVirtioOptions *virtio; virObject *privateData; }; diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index efd49cfa01..ddbd9fa07d 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -3130,6 +3130,15 @@ + + + + + + + + + diff --git a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml b/tests/qem= uxml2argvdata/vhost-user-fs-fd-memory.xml index abddf0870b..81de8c0dd7 100644 --- a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml +++ b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml @@ -32,6 +32,7 @@ + --=20 2.35.1 From nobody Sat Feb 7 13:02:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1654867557; cv=none; d=zohomail.com; s=zohoarc; b=nwha5n+kh+JoP0ePndvtrvUsAEDUZ56NVeWwi7kOg8iWfvx6l3DPQ+AbjD1bgRZ2w+V8CpjteKwt61hO1pezF/oy+fGE+OJYP3rK6dwDN9GD4c0c8jymDK3rJtTykH1sgJVFCIe6RM+hywYGmROmY5uXiM3GDjK5aJTGDisL3U0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654867557; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YQnKteHGh2dX4rwf8A/MCJ0u4xZ4iKuNeNGzTHmIbwM=; b=a0ntfd4mfJOP82awB9+Xb/9uXWbx9HuYl9ygSWfmJ//bO8KQf0+OR79K2rbXn+QOGbXWnWpAnG9c+1ZOFKtoTvYLEOoRHOqMXFZKjMPpO1BMEozX42HFBRsSVRjtlhmrVbtxiNtB7cShwexfQW7VkyCalaMNDppgm1JVxFezC0s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1654867557375377.5238780914549; Fri, 10 Jun 2022 06:25:57 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-572-9PxLqYWoPuKuOAWIl2jKyw-1; Fri, 10 Jun 2022 09:25:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4D389858F11; Fri, 10 Jun 2022 13:25:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE1F317452; Fri, 10 Jun 2022 13:25:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 54F9D194704E; Fri, 10 Jun 2022 13:25:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C52EE1947059 for ; Fri, 10 Jun 2022 13:25:48 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 960981410DDB; Fri, 10 Jun 2022 13:25:48 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D2661400E75 for ; Fri, 10 Jun 2022 13:25:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654867556; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=YQnKteHGh2dX4rwf8A/MCJ0u4xZ4iKuNeNGzTHmIbwM=; b=GjFToJbUXLd2b62FOvp/xuRmL5Z/GMYO7R0iaVWlQj5RPpEmLFvtnoEkzjU325AK5ZuEuG ypsPP565ReViXIuQFDciQFjL+ZeibeQeNXEh1SPs20e8XbjJcTGz0H1UxDt/ufHlPtnxr6 f84V2+Ty35uLcA2atLS5t9A2G/e/PgI= X-MC-Unique: 9PxLqYWoPuKuOAWIl2jKyw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] qemu: virtiofs: format --thread-pool-size Date: Fri, 10 Jun 2022 15:25:44 +0200 Message-Id: <8fd3a20f2e5c24cb98f7a349d54896609c433b16.1654867527.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1654867558610100002 https://bugzilla.redhat.com/show_bug.cgi?id=3D2079582 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/qemu/qemu_virtiofs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c index 7e3324b017..ce55286ab5 100644 --- a/src/qemu/qemu_virtiofs.c +++ b/src/qemu/qemu_virtiofs.c @@ -163,6 +163,10 @@ qemuVirtioFSBuildCommandLine(virQEMUDriverConfig *cfg, virBufferAddLit(&opts, ",no_posix_lock"); =20 virCommandAddArgBuffer(cmd, &opts); + + if (fs->thread_pool_size >=3D 0) + virCommandAddArgFormat(cmd, "--thread-pool-size=3D%i", fs->thread_= pool_size); + if (cfg->virtiofsdDebug) virCommandAddArg(cmd, "-d"); =20 --=20 2.35.1