public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server/docs/manager v1 0/5] virtiofs: add thread-pool-size and improve docs
@ 2025-05-05 15:05 Markus Frank
  2025-05-05 15:05 ` [pve-devel] [PATCH qemu-server v1 1/5] fix #6370: virtiofs: add support for thread-pool-size option Markus Frank
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Markus Frank @ 2025-05-05 15:05 UTC (permalink / raw)
  To: pve-devel

qemu-server:

Markus Frank (1):
  fix #6370: virtiofs: add support for thread-pool-size option

 PVE/QemuServer/Virtiofs.pm | 9 +++++++++
 1 file changed, 9 insertions(+)


docs:

Markus Frank (3):
  virtiofs: add explanation for cache=metadata behavior
  virtiofs: add table for optional parameters
  virtiofs: add thread-pool-size description

 qm.adoc | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)


manager:

Markus Frank (1):
  fix #6370: ui: virtiofs edit: add support for thread-pool-size option

 www/manager6/qemu/VirtiofsEdit.js | 10 ++++++++++
 1 file changed, 10 insertions(+)

-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH qemu-server v1 1/5] fix #6370: virtiofs: add support for thread-pool-size option
  2025-05-05 15:05 [pve-devel] [PATCH qemu-server/docs/manager v1 0/5] virtiofs: add thread-pool-size and improve docs Markus Frank
@ 2025-05-05 15:05 ` Markus Frank
  2025-05-05 15:05 ` [pve-devel] [PATCH docs v1 2/5] virtiofs: add explanation for cache=metadata behavior Markus Frank
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Markus Frank @ 2025-05-05 15:05 UTC (permalink / raw)
  To: pve-devel

Allows tuning the number of worker threads used by virtiofsd.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
 PVE/QemuServer/Virtiofs.pm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/PVE/QemuServer/Virtiofs.pm b/PVE/QemuServer/Virtiofs.pm
index cfde92c9..1894c95d 100644
--- a/PVE/QemuServer/Virtiofs.pm
+++ b/PVE/QemuServer/Virtiofs.pm
@@ -57,6 +57,13 @@ my $virtiofs_fmt = {
 	default => 0,
 	optional => 1,
     },
+    'thread-pool-size' => {
+	type => 'integer',
+	description => "Controls the maximum number of worker threads used by virtiofsd to handle"
+	    ." requests. A value of '0' disables the thread pool.",
+	default => 0,
+	optional => 1,
+    },
 };
 PVE::JSONSchema::register_format('pve-qm-virtiofs', $virtiofs_fmt);
 
@@ -172,6 +179,8 @@ sub start_virtiofsd {
 	    my $cmd = [$virtiofsd_bin, "--fd=$fd", "--shared-dir=$path"];
 	    push @$cmd, '--xattr' if $virtiofs->{'expose-xattr'};
 	    push @$cmd, '--posix-acl' if $virtiofs->{'expose-acl'};
+	    push @$cmd, '--thread-pool-size='.$virtiofs->{'thread-pool-size'}
+		if $virtiofs->{'thread-pool-size'};
 	    push @$cmd, '--announce-submounts';
 	    push @$cmd, '--allow-direct-io' if $virtiofs->{'direct-io'};
 	    push @$cmd, '--cache='.$virtiofs->{cache} if $virtiofs->{cache};
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH docs v1 2/5] virtiofs: add explanation for cache=metadata behavior
  2025-05-05 15:05 [pve-devel] [PATCH qemu-server/docs/manager v1 0/5] virtiofs: add thread-pool-size and improve docs Markus Frank
  2025-05-05 15:05 ` [pve-devel] [PATCH qemu-server v1 1/5] fix #6370: virtiofs: add support for thread-pool-size option Markus Frank
@ 2025-05-05 15:05 ` Markus Frank
  2025-05-05 15:05 ` [pve-devel] [PATCH docs v1 3/5] virtiofs: add table for optional parameters Markus Frank
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Markus Frank @ 2025-05-05 15:05 UTC (permalink / raw)
  To: pve-devel

Adds a description of the `cache=metadata` mode and references the
upstream patch that introduced it.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
 qm.adoc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/qm.adoc b/qm.adoc
index 8b9e096..74f8304 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -1315,7 +1315,9 @@ has been configured in the resource mapping. Additionally, you can set the
 `cache` option to either `always`, `never`, `metadata`, or `auto` (default:
 `auto`), depending on your requirements. How the different caching modes behave
 can be read https://lwn.net/Articles/774495/[here under the "Caching Modes"
-section].
+section]. The https://gitlab.com/virtio-fs/virtiofsd/-/commit/598ca8e[`metadata`]
+policy is similar to `never`, but it allows guests to cache filesystem metadata,
+such as dcache and attr.
 
 The `virtiofsd` supports ACL and xattr passthrough (can be enabled with the
 `expose-acl` and `expose-xattr` options), allowing the guest to access ACLs and
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH docs v1 3/5] virtiofs: add table for optional parameters
  2025-05-05 15:05 [pve-devel] [PATCH qemu-server/docs/manager v1 0/5] virtiofs: add thread-pool-size and improve docs Markus Frank
  2025-05-05 15:05 ` [pve-devel] [PATCH qemu-server v1 1/5] fix #6370: virtiofs: add support for thread-pool-size option Markus Frank
  2025-05-05 15:05 ` [pve-devel] [PATCH docs v1 2/5] virtiofs: add explanation for cache=metadata behavior Markus Frank
@ 2025-05-05 15:05 ` Markus Frank
  2025-05-05 15:05 ` [pve-devel] [PATCH docs v1 4/5] virtiofs: add thread-pool-size description Markus Frank
  2025-05-05 15:05 ` [pve-devel] [PATCH manager v1 5/5] fix #6370: ui: virtiofs edit: add support for thread-pool-size option Markus Frank
  4 siblings, 0 replies; 6+ messages in thread
From: Markus Frank @ 2025-05-05 15:05 UTC (permalink / raw)
  To: pve-devel

Removes redundant explanatory text now covered by the table.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
 qm.adoc | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/qm.adoc b/qm.adoc
index 74f8304..1549705 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -1325,12 +1325,16 @@ xattrs if the underlying host filesystem supports them, but they must also be
 compatible with the guest filesystem (for example most Linux filesystems support
 ACLs, while Windows filesystems do not).
 
-The `expose-acl` option automatically implies `expose-xattr`, that is, it makes
-no difference if you set `expose-xattr` to `0` if `expose-acl` is set to `1`.
-
-If you want virtiofs to honor the `O_DIRECT` flag, you can set the `direct-io`
-parameter to `1` (default: `0`). This will degrade performance, but is useful if
-applications do their own caching.
+All Optional Parameters:
+
+[cols="1,3,1", options="header"]
+|===
+|Parameter |Description |Default
+|`cache` |Sets caching mode: `always`, `never`, `metadata`, or `auto`. |`auto`
+|`expose-acl` |Enables ACL passthrough; implies `expose-xattr`. Supported only on compatible filesystems. |`0`
+|`expose-xattr` |Enables xattr passthrough; redundant if `expose-acl` is `1`. |`0`
+|`direct-io` |Enables support for the `O_DIRECT` flag. May degrade performance, but is useful if applications perform their own caching. |`0`
+|===
 
 ----
 qm set <vmid> -virtiofs0 dirid=<dirid>,cache=always,direct-io=1
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH docs v1 4/5] virtiofs: add thread-pool-size description
  2025-05-05 15:05 [pve-devel] [PATCH qemu-server/docs/manager v1 0/5] virtiofs: add thread-pool-size and improve docs Markus Frank
                   ` (2 preceding siblings ...)
  2025-05-05 15:05 ` [pve-devel] [PATCH docs v1 3/5] virtiofs: add table for optional parameters Markus Frank
@ 2025-05-05 15:05 ` Markus Frank
  2025-05-05 15:05 ` [pve-devel] [PATCH manager v1 5/5] fix #6370: ui: virtiofs edit: add support for thread-pool-size option Markus Frank
  4 siblings, 0 replies; 6+ messages in thread
From: Markus Frank @ 2025-05-05 15:05 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
 qm.adoc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/qm.adoc b/qm.adoc
index 1549705..8cf75ca 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -1334,12 +1334,13 @@ All Optional Parameters:
 |`expose-acl` |Enables ACL passthrough; implies `expose-xattr`. Supported only on compatible filesystems. |`0`
 |`expose-xattr` |Enables xattr passthrough; redundant if `expose-acl` is `1`. |`0`
 |`direct-io` |Enables support for the `O_DIRECT` flag. May degrade performance, but is useful if applications perform their own caching. |`0`
+|`thread-pool-size` |Controls the maximum number of worker threads used by virtiofsd to handle requests. Adjust for performance tuning. `0` disables the thread pool. |`0`
 |===
 
 ----
 qm set <vmid> -virtiofs0 dirid=<dirid>,cache=always,direct-io=1
 qm set <vmid> -virtiofs1 <dirid>,cache=never,expose-xattr=1
-qm set <vmid> -virtiofs2 <dirid>,expose-acl=1
+qm set <vmid> -virtiofs2 <dirid>,expose-acl=1,thread-pool-size=16
 ----
 
 To temporarily mount virtiofs in a guest VM with the Linux kernel virtiofs
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH manager v1 5/5] fix #6370: ui: virtiofs edit: add support for thread-pool-size option
  2025-05-05 15:05 [pve-devel] [PATCH qemu-server/docs/manager v1 0/5] virtiofs: add thread-pool-size and improve docs Markus Frank
                   ` (3 preceding siblings ...)
  2025-05-05 15:05 ` [pve-devel] [PATCH docs v1 4/5] virtiofs: add thread-pool-size description Markus Frank
@ 2025-05-05 15:05 ` Markus Frank
  4 siblings, 0 replies; 6+ messages in thread
From: Markus Frank @ 2025-05-05 15:05 UTC (permalink / raw)
  To: pve-devel

Requires the qemu-server commit named "fix #6370: virtiofs: add support
for thread-pool-size option".

Set the maximum value to '256', the same as for the VM CPU cores.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
 www/manager6/qemu/VirtiofsEdit.js | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/www/manager6/qemu/VirtiofsEdit.js b/www/manager6/qemu/VirtiofsEdit.js
index 6983a763..33d38de4 100644
--- a/www/manager6/qemu/VirtiofsEdit.js
+++ b/www/manager6/qemu/VirtiofsEdit.js
@@ -81,6 +81,16 @@ Ext.define('PVE.qemu.VirtiofsInputPanel', {
 		name: 'direct-io',
 		fieldLabel: gettext('Allow Direct IO'),
 	    },
+	    {
+		xtype: 'proxmoxintegerfield',
+		name: 'thread-pool-size',
+		minValue: 0,
+		maxValue: 256,
+		value: '',
+		emptyText: '0',
+		allowBlank: true,
+		fieldLabel: gettext('thread-pool-size'),
+	    },
 	];
 
 	me.virtiofs = {};
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

end of thread, other threads:[~2025-05-05 15:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-05 15:05 [pve-devel] [PATCH qemu-server/docs/manager v1 0/5] virtiofs: add thread-pool-size and improve docs Markus Frank
2025-05-05 15:05 ` [pve-devel] [PATCH qemu-server v1 1/5] fix #6370: virtiofs: add support for thread-pool-size option Markus Frank
2025-05-05 15:05 ` [pve-devel] [PATCH docs v1 2/5] virtiofs: add explanation for cache=metadata behavior Markus Frank
2025-05-05 15:05 ` [pve-devel] [PATCH docs v1 3/5] virtiofs: add table for optional parameters Markus Frank
2025-05-05 15:05 ` [pve-devel] [PATCH docs v1 4/5] virtiofs: add thread-pool-size description Markus Frank
2025-05-05 15:05 ` [pve-devel] [PATCH manager v1 5/5] fix #6370: ui: virtiofs edit: add support for thread-pool-size option Markus Frank

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal