From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 2/4] drive commandline: factor out checks if io_uring is allowed by default
Date: Fri, 10 Feb 2023 15:19:10 +0100 [thread overview]
Message-ID: <20230210141912.108195-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20230210141912.108195-1-f.ebner@proxmox.com>
while getting rid of the double negation.
In preparation to re-use the check for live disk cloning.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
PVE/QemuServer.pm | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 6130fe82..10d29a06 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1598,6 +1598,23 @@ sub get_initiator_name {
return $initiator;
}
+my sub storage_allows_io_uring_default {
+ my ($scfg, $cache_direct) = @_;
+
+ # io_uring with cache mode writeback or writethrough on krbd will hang...
+ return if $scfg && $scfg->{type} eq 'rbd' && $scfg->{krbd} && !$cache_direct;
+
+ # io_uring with cache mode writeback or writethrough on LVM will hang, without cache only
+ # sometimes, just plain disable...
+ return if $scfg && $scfg->{type} eq 'lvm';
+
+ # io_uring causes problems when used with CIFS since kernel 5.15
+ # Some discussion: https://www.spinics.net/lists/linux-cifs/msg26734.html
+ return if $scfg && $scfg->{type} eq 'cifs';
+
+ return 1;
+}
+
sub print_drive_commandline_full {
my ($storecfg, $vmid, $drive, $pbs_name, $io_uring) = @_;
@@ -1680,19 +1697,8 @@ sub print_drive_commandline_full {
$cache_direct = 1;
}
- # io_uring with cache mode writeback or writethrough on krbd will hang...
- my $rbd_no_io_uring = $scfg && $scfg->{type} eq 'rbd' && $scfg->{krbd} && !$cache_direct;
-
- # io_uring with cache mode writeback or writethrough on LVM will hang, without cache only
- # sometimes, just plain disable...
- my $lvm_no_io_uring = $scfg && $scfg->{type} eq 'lvm';
-
- # io_uring causes problems when used with CIFS since kernel 5.15
- # Some discussion: https://www.spinics.net/lists/linux-cifs/msg26734.html
- my $cifs_no_io_uring = $scfg && $scfg->{type} eq 'cifs';
-
if (!$drive->{aio}) {
- if ($io_uring && !$rbd_no_io_uring && !$lvm_no_io_uring && !$cifs_no_io_uring) {
+ if ($io_uring && storage_allows_io_uring_default($scfg, $cache_direct)) {
# io_uring supports all cache modes
$opts .= ",aio=io_uring";
} else {
--
2.30.2
next prev parent reply other threads:[~2023-02-10 14:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 14:19 [pve-devel] [PATCH qemu-server 1/4] hotplug: disk: mark aio as non-hotpluggable Fiona Ebner
2023-02-10 14:19 ` Fiona Ebner [this message]
2023-02-10 14:19 ` [pve-devel] [PATCH qemu-server 3/4] drive commandline: factor out determining direct cache usage into helper Fiona Ebner
2023-02-10 14:19 ` [pve-devel] [PATCH qemu-server 4/4] fix #4525: clone disk: disallow mirror if it might cause problems with io_uring Fiona Ebner
2023-02-14 9:12 ` [pve-devel] applied-series: Re: [PATCH qemu-server 1/4] hotplug: disk: mark aio as non-hotpluggable Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230210141912.108195-2-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox