* [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol
@ 2026-08-20 9:05 Christian Ebner
2026-08-20 9:05 ` [PATCH v3 pve-qemu 1/1] pbs-restore: add optional no-cache flag to bypass host page cache Christian Ebner
` (8 more replies)
0 siblings, 9 replies; 12+ messages in thread
From: Christian Ebner @ 2026-08-20 9:05 UTC (permalink / raw)
To: pve-devel
This patch series skips writing to the host page cache for restores
to zvols, with the intention to avoid potential I/O delay issues for
other ZFS-backed VMs during page writeback on certain setups, as
reported in enterprise support and reproduced internally.
This patch series adds an optional no-cache parameter for pbs-restore
command invocation, setting the BDRV_O_NOCACHE flag for the block
device being restored to and sets `cache=none` for vma restores.
Since this seems to affect only zvol's, conditionally set the flag only
during restores to storages with type `zfspool`.
pve-qemu:
Christian Ebner (1):
pbs-restore: add optional no-cache flag to bypass host page cache
...no-cache-flag-to-skip-host-page-cach.patch | 72 +++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 73 insertions(+)
create mode 100644 debian/patches/pve/0047-pbs-restore-add-no-cache-flag-to-skip-host-page-cach.patch
qemu-server:
Christian Ebner (5):
helpers: never cache `unknown` on failed kvm binary version check
helpers: optionally get package version for kvm_user_version()
helpers: add helper for min kvm package version comparison
pbs-restore: set 'no-cache' on block devices backed by zfspool
vma restore: skip page cache on block devices backed by zfspool
src/PVE/QemuServer.pm | 21 +++++++++++++++++-
src/PVE/QemuServer/Helpers.pm | 41 ++++++++++++++++++++++++++++-------
2 files changed, 53 insertions(+), 9 deletions(-)
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 pve-qemu 1/1] pbs-restore: add optional no-cache flag to bypass host page cache
2026-08-20 9:05 [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Christian Ebner
@ 2026-08-20 9:05 ` Christian Ebner
2026-08-20 9:05 ` [PATCH v3 qemu-server 2/6] helpers: never cache `unknown` on failed kvm binary version check Christian Ebner
` (7 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Christian Ebner @ 2026-08-20 9:05 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Jonas Theisen <j.theisen@proxmox.com>
---
changes since version 2:
- Extended commit message for patch to include further details and the
link to the forum thread
- adapted commit title to use pbs-restore as prefix tag
...no-cache-flag-to-skip-host-page-cach.patch | 72 +++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 73 insertions(+)
create mode 100644 debian/patches/pve/0047-pbs-restore-add-no-cache-flag-to-skip-host-page-cach.patch
diff --git a/debian/patches/pve/0047-pbs-restore-add-no-cache-flag-to-skip-host-page-cach.patch b/debian/patches/pve/0047-pbs-restore-add-no-cache-flag-to-skip-host-page-cach.patch
new file mode 100644
index 0000000..624685e
--- /dev/null
+++ b/debian/patches/pve/0047-pbs-restore-add-no-cache-flag-to-skip-host-page-cach.patch
@@ -0,0 +1,72 @@
+From d7ca855d826bb20cd896fe95e1cc2154ce32980d Mon Sep 17 00:00:00 2001
+From: Christian Ebner <c.ebner@proxmox.com>
+Date: Mon, 17 Aug 2026 10:21:58 +0200
+Subject: [PATCH] pbs-restore: add no-cache flag to skip host page cache on
+ restore
+
+Optional flag which allows to set BDRV_O_NOCACHE on the block
+backend, forcing to skipping the host page cache while restoring.
+
+Allows to explicitly skip the page cache for cases where it can cause
+issues. The paage cache is filled during restores and can cause I/O
+delay issues once page writeback starts, not only limited to VM's on
+the same pool but possibly also affecting other ZFS-backed VMs on
+certain setups, as reported in the enterprise repository and in the
+community forum [0].
+
+Keeping it opt-in for full backwards compatibility, allowing to only
+enable it on targets where required.
+
+[0] https://forum.proxmox.com/threads/185023/
+
+Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
+---
+ pbs-restore.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/pbs-restore.c b/pbs-restore.c
+index f165f418af..55a3cb235d 100644
+--- a/pbs-restore.c
++++ b/pbs-restore.c
+@@ -81,6 +81,7 @@ int main(int argc, char **argv)
+ const char *keyfile = NULL;
+ int verbose = false;
+ bool skip_zero = false;
++ bool no_cache = false;
+
+ error_init(argv[0]);
+
+@@ -93,6 +94,7 @@ int main(int argc, char **argv)
+ {"repository", required_argument, 0, 'r'},
+ {"ns", required_argument, 0, 'n'},
+ {"keyfile", required_argument, 0, 'k'},
++ {"no-cache", no_argument, 0, 'N'},
+ {0, 0, 0, 0}
+ };
+ int c = getopt_long(argc, argv, "hvf:r:k:", long_options, NULL);
+@@ -124,6 +126,9 @@ int main(int argc, char **argv)
+ case 'S':
+ skip_zero = true;
+ break;
++ case 'N':
++ no_cache = true;
++ break;
+ case 'h':
+ help();
+ return 0;
+@@ -198,6 +203,12 @@ int main(int argc, char **argv)
+ }
+ Error *local_err = NULL;
+ int flags = BDRV_O_RDWR;
++ if (no_cache) {
++ flags |= BDRV_O_NOCACHE;
++ if (verbose) {
++ fprintf(stderr, "skip host page cache for restore of '%s'\n", target);
++ }
++ }
+ BlockBackend *blk = blk_new_open(target, NULL, options, flags, &local_err);
+ if (!blk) {
+ fprintf(stderr, "%s\n", error_get_pretty(local_err));
+--
+2.47.3
+
diff --git a/debian/patches/series b/debian/patches/series
index 4f9ed75..6ef37f4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -76,3 +76,4 @@ pve/0043-PVE-backup-get-device-info-allow-caller-to-specify-f.patch
pve/0044-PVE-backup-implement-backup-access-setup-and-teardow.patch
pve/0045-PVE-backup-prepare-for-the-switch-to-using-blockdev-.patch
pve/0046-savevm-async-reuse-migration-blocker-check-for-snaps.patch
+pve/0047-pbs-restore-add-no-cache-flag-to-skip-host-page-cach.patch
--
2.47.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 qemu-server 2/6] helpers: never cache `unknown` on failed kvm binary version check
2026-08-20 9:05 [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Christian Ebner
2026-08-20 9:05 ` [PATCH v3 pve-qemu 1/1] pbs-restore: add optional no-cache flag to bypass host page cache Christian Ebner
@ 2026-08-20 9:05 ` Christian Ebner
2026-08-20 9:05 ` [PATCH v3 qemu-server 3/6] helpers: optionally get package version for kvm_user_version() Christian Ebner
` (6 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Christian Ebner @ 2026-08-20 9:05 UTC (permalink / raw)
To: pve-devel
Rather than init and cache the version as `unknown` in case the
version check fails, which it would remain until the modified
timestamp of the binary changes, only return unknown for this call
and allow to reattempt. While at it, improve code by explicitley
checking for the hash value being defined.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
changes since version 2:
- new in this version
src/PVE/QemuServer/Helpers.pm | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
index dd17eef5..ebb1a874 100644
--- a/src/PVE/QemuServer/Helpers.pm
+++ b/src/PVE/QemuServer/Helpers.pm
@@ -60,10 +60,9 @@ sub kvm_user_version {
my $cachedmtime = $kvm_mtime->{$binary} // -1;
return $kvm_user_version->{$binary}
- if $kvm_user_version->{$binary}
+ if defined($kvm_user_version->{$binary})
&& $cachedmtime == $st->mtime;
- $kvm_user_version->{$binary} = 'unknown';
$kvm_mtime->{$binary} = $st->mtime;
my $code = sub {
@@ -76,7 +75,7 @@ sub kvm_user_version {
eval { PVE::Tools::run_command([$binary, '--version'], outfunc => $code); };
warn $@ if $@;
- return $kvm_user_version->{$binary};
+ return defined($kvm_user_version->{$binary}) ? $kvm_user_version->{$binary} : 'unknown';
}
# Paths and directories
--
2.47.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 qemu-server 3/6] helpers: optionally get package version for kvm_user_version()
2026-08-20 9:05 [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Christian Ebner
2026-08-20 9:05 ` [PATCH v3 pve-qemu 1/1] pbs-restore: add optional no-cache flag to bypass host page cache Christian Ebner
2026-08-20 9:05 ` [PATCH v3 qemu-server 2/6] helpers: never cache `unknown` on failed kvm binary version check Christian Ebner
@ 2026-08-20 9:05 ` Christian Ebner
2026-08-20 9:05 ` [PATCH v3 qemu-server 4/6] helpers: add helper for min kvm package version comparison Christian Ebner
` (5 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Christian Ebner @ 2026-08-20 9:05 UTC (permalink / raw)
To: pve-devel
Allows to specify whether to return the binary version or the package
version by adding a flag to kvm_user_version(). This will allow
comparing the package version including it's revision when the binary
version is not enough. Regex matching is performed on both, the
package version being kept as optional for full backwards compatibility
in the binary version check case.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
changes since version 2:
- precompile regex via qr
- adapt binary version regex variable name
- add dedicated regex for package version, dropping subversion and
therefore only matching major.minor.micro-rel
- keep package version regex matching optional for full backwards
compat in binary version check case
src/PVE/QemuServer/Helpers.pm | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
index ebb1a874..8047d9e6 100644
--- a/src/PVE/QemuServer/Helpers.pm
+++ b/src/PVE/QemuServer/Helpers.pm
@@ -53,29 +53,42 @@ my $kvm_user_version = {};
my $kvm_mtime = {};
sub kvm_user_version {
- my ($binary) = @_;
+ my ($binary, $query_package_version) = @_;
$binary //= get_command_for_arch(get_host_arch()); # get the native arch by default
my $st = stat($binary);
my $cachedmtime = $kvm_mtime->{$binary} // -1;
- return $kvm_user_version->{$binary}
- if defined($kvm_user_version->{$binary})
- && $cachedmtime == $st->mtime;
+ my $version_type = $query_package_version ? 'package' : 'version';
+ if (defined($kvm_user_version->{$binary}->{$version_type}) && $cachedmtime == $st->mtime) {
+ return $kvm_user_version->{$binary}->{$version_type};
+ }
$kvm_mtime->{$binary} = $st->mtime;
+ my $binary_version_re = qr/(\d+\.\d+(\.\d+)?)(\.\d+)?/;
+ my $package_version_re = qr/\(pve-qemu-kvm_(\d+\.\d+(\.\d+)?-\d+)\)/;
+
my $code = sub {
my $line = shift;
- if ($line =~ m/^QEMU( PC)? emulator version (\d+\.\d+(\.\d+)?)(\.\d+)?[,\s]/) {
- $kvm_user_version->{$binary} = $2;
+ if ($line =~
+ m/^QEMU( PC)? emulator version $binary_version_re[,\s]($package_version_re)?/
+ ) {
+ $kvm_user_version->{$binary} = {
+ version => $2,
+ package => $6,
+ };
}
};
eval { PVE::Tools::run_command([$binary, '--version'], outfunc => $code); };
warn $@ if $@;
- return defined($kvm_user_version->{$binary}) ? $kvm_user_version->{$binary} : 'unknown';
+ if (defined($kvm_user_version->{$binary}->{$version_type})) {
+ return $kvm_user_version->{$binary}->{$version_type};
+ }
+
+ return 'unknown';
}
# Paths and directories
--
2.47.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 qemu-server 4/6] helpers: add helper for min kvm package version comparison
2026-08-20 9:05 [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Christian Ebner
` (2 preceding siblings ...)
2026-08-20 9:05 ` [PATCH v3 qemu-server 3/6] helpers: optionally get package version for kvm_user_version() Christian Ebner
@ 2026-08-20 9:05 ` Christian Ebner
2026-08-20 9:05 ` [PATCH v3 qemu-server 5/6] pbs-restore: set 'no-cache' on block devices backed by zfspool Christian Ebner
` (4 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Christian Ebner @ 2026-08-20 9:05 UTC (permalink / raw)
To: pve-devel
To be used for checking the minimum version of qemu-kvm package
version, where the binary version check is not enough to detect
versions having the pbs-restore `no-cache` flag.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
changes since version 2:
- adapt helper function name to fit better to codebase and be more
expressive
- call kvm_user_version() from helper itself instead of fetching and
passing the version string, reducing potential misuse.
- drop useless $subver matching
src/PVE/QemuServer/Helpers.pm | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
index 8047d9e6..5065a457 100644
--- a/src/PVE/QemuServer/Helpers.pm
+++ b/src/PVE/QemuServer/Helpers.pm
@@ -21,6 +21,7 @@ our @EXPORT_OK = qw(
parse_number_sets
windows_version
get_host_arch
+ binary_package_version_at_least
);
my $nodename = PVE::INotify::nodename();
@@ -91,6 +92,18 @@ sub kvm_user_version {
return 'unknown';
}
+sub binary_package_version_at_least {
+ my ($major, $minor, $micro, $rel, $binary) = @_;
+
+ my $package_version_str = kvm_user_version($binary, 1);
+ if ($package_version_str =~ m/^(\d+)\.(\d+)(?:\.(\d+))?-(\d+)/) {
+ return 1 if version_cmp($1, $major, $2, $minor, $3 // 0, $micro, $4, $rel) >= 0;
+ return 0;
+ }
+
+ die "internal error: cannot check version of invalid string '$package_version_str'";
+}
+
# Paths and directories
# FIXME: MAJOR VERSION: use /run/qemu-server everywhere instead of mixing /run and /var/run and rely
--
2.47.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 qemu-server 5/6] pbs-restore: set 'no-cache' on block devices backed by zfspool
2026-08-20 9:05 [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Christian Ebner
` (3 preceding siblings ...)
2026-08-20 9:05 ` [PATCH v3 qemu-server 4/6] helpers: add helper for min kvm package version comparison Christian Ebner
@ 2026-08-20 9:05 ` Christian Ebner
2026-08-20 9:05 ` [PATCH v3 qemu-server 6/6] vma restore: skip page cache " Christian Ebner
` (3 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Christian Ebner @ 2026-08-20 9:05 UTC (permalink / raw)
To: pve-devel
Skip the host page cache for restores on zvols, as page writeback
after filling the buffers can cause I/O delay on other ZFS-backed VMs
on certain setups, as reported in enterprise support and reproduced
internally. The restored data is not to be read back from cache
during restore anyways.
Keep for other storage types for now to reduce regression potential.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
changes since version 2:
- adapt to new helper name and interface
src/PVE/QemuServer.pm | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 2f43faa7..21924988 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -7090,6 +7090,16 @@ sub restore_proxmox_backup_archive {
if (PVE::Storage::volume_has_feature($storecfg, 'sparseinit', $volid)) {
push @$pbs_restore_cmd, '--skip-zero';
}
+ my ($target_storeid) = PVE::Storage::parse_volume_id($volid, 1);
+ my $target_scfg = PVE::Storage::storage_config($storecfg, $target_storeid);
+
+ if (
+ PVE::QemuServer::Helpers::binary_package_version_at_least(11, 0, 3, 3)
+ && $target_scfg->{type} eq 'zfspool'
+ ) {
+ #TODO: potentially extend to other storage types
+ push @$pbs_restore_cmd, '--no-cache';
+ }
my $dbg_cmdstring = PVE::Tools::cmd2string($pbs_restore_cmd);
print "restore proxmox backup image: $dbg_cmdstring\n";
--
2.47.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 qemu-server 6/6] vma restore: skip page cache on block devices backed by zfspool
2026-08-20 9:05 [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Christian Ebner
` (4 preceding siblings ...)
2026-08-20 9:05 ` [PATCH v3 qemu-server 5/6] pbs-restore: set 'no-cache' on block devices backed by zfspool Christian Ebner
@ 2026-08-20 9:05 ` Christian Ebner
2026-08-20 9:56 ` [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Lukas Sichert
` (2 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Christian Ebner @ 2026-08-20 9:05 UTC (permalink / raw)
To: pve-devel
Skip the host page cache for restores on zvols, as page writeback
after filling the buffers can cause I/O delay on other ZFS-backed VMs
on certain setups, as reported in enterprise support and reproduced
internally. The restored data is not to be read back from cache
during restore anyways.
Keep for other storage types for now to reduce regression potential.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Tested-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/PVE/QemuServer.pm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 21924988..a40d13a5 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -7677,8 +7677,17 @@ sub restore_vma_archive {
}
my $path = PVE::Storage::path($cfg, $volid);
+ my $scfg = PVE::Storage::storage_config($cfg, $storeid);
- print $fifofh "${map_opts}format=$d->{format}:${write_zeros}:$d->{devname}=$path\n";
+ my $cache_none = '';
+ if ($scfg->{type} eq 'zfspool') {
+ #TODO: potentially extend to other storage types
+ $cache_none = ':cache=none';
+ print "skipping page cache for '$d->{devname}'\n";
+ }
+
+ print $fifofh
+ "${map_opts}format=$d->{format}${cache_none}:${write_zeros}:$d->{devname}=$path\n";
print "map '$d->{devname}' to '$path' (write zeros = ${write_zeros})\n";
}
--
2.47.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol
2026-08-20 9:05 [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Christian Ebner
` (5 preceding siblings ...)
2026-08-20 9:05 ` [PATCH v3 qemu-server 6/6] vma restore: skip page cache " Christian Ebner
@ 2026-08-20 9:56 ` Lukas Sichert
2026-08-20 12:07 ` Thomas Lamprecht
2026-08-20 11:36 ` Lukas Sichert
2026-08-20 13:12 ` Christian Ebner
8 siblings, 1 reply; 12+ messages in thread
From: Lukas Sichert @ 2026-08-20 9:56 UTC (permalink / raw)
To: Christian Ebner, pve-devel
On 2026-08-20 11:05, Christian Ebner <c.ebner@proxmox.com> wrote:
> This patch series skips writing to the host page cache for restores
> to zvols, with the intention to avoid potential I/O delay issues for
> other ZFS-backed VMs during page writeback on certain setups, as
> reported in enterprise support and reproduced internally.
>
> This patch series adds an optional no-cache parameter for pbs-restore
> command invocation, setting the BDRV_O_NOCACHE flag for the block
> device being restored to and sets `cache=none` for vma restores.
When I test patched debs on my testmachines I normally bump the version
with a local<x> suffigx. package_name_1.2.3 is deployed as
package_name_1.2.3+local1. When starting a restore with this and v2, I got
the error 'TASK ERROR: internal error: cannot check version of invalid
string 'unknown' at /usr/share/perl5/PVE/QemuServer/Helpers.pm line 104.'
Christian proposed the following diff off-list, which worked for me.
diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
index 5065a457..1ed48a3b 100644
--- a/src/PVE/QemuServer/Helpers.pm
+++ b/src/PVE/QemuServer/Helpers.pm
@@ -68,7 +68,7 @@ sub kvm_user_version {
$kvm_mtime->{$binary} = $st->mtime;
my $binary_version_re = qr/(\d+\.\d+(\.\d+)?)(\.\d+)?/;
- my $package_version_re = qr/\(pve-qemu-kvm_(\d+\.\d+(\.\d+)?-\d+)\)/;
+ my $package_version_re = qr/\(pve-qemu-kvm_(\d+\.\d+(\.\d+)?-\d+)(\+[a-zA-Z0-9]+)?\)/;
my $code = sub {
my $line = shift;
I wouldn't consider this a blocker, but it would be a nice to have in a
potential next version.
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol
2026-08-20 9:05 [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Christian Ebner
` (6 preceding siblings ...)
2026-08-20 9:56 ` [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Lukas Sichert
@ 2026-08-20 11:36 ` Lukas Sichert
2026-08-20 13:12 ` Christian Ebner
8 siblings, 0 replies; 12+ messages in thread
From: Lukas Sichert @ 2026-08-20 11:36 UTC (permalink / raw)
To: Christian Ebner, pve-devel
On 2026-08-20 11:05, Christian Ebner <c.ebner@proxmox.com> wrote:
> This patch series skips writing to the host page cache for restores
> to zvols, with the intention to avoid potential I/O delay issues for
> other ZFS-backed VMs during page writeback on certain setups, as
> reported in enterprise support and reproduced internally.
>
> This patch series adds an optional no-cache parameter for pbs-restore
> command invocation, setting the BDRV_O_NOCACHE flag for the block
> device being restored to and sets `cache=none` for vma restores.
>
> Since this seems to affect only zvol's, conditionally set the flag only
> during restores to storages with type `zfspool`.
Tested this on a PVE VM whose disk is backed by ZFS, with another VM
acting as PBS. Inside the PVE VM, I created a Linux VM with a 200 GB
disk and wrote 150 GB of data to it. I also installed a Windows Server
2026 VM alongside the inner PVE VM.
During restore, the Dirty and Writeback page cache values from
/proc/meminfo, as reported by the outer PVE VM, were in the 1-4.5 GB
range. ioping reported delays of up to 10 seconds. The Windows VM
stalled; while I was still able to drag windows around, it was not
possible to open any new applications.
After applying the patch, the host page cache values did not increase
when starting a restore and remained basically at zero, with at most
100 KB. The Windows VM was still very slow, but during restore it was
eventually able to open applications. The ioping issue was also
resolved.
One nit:
I already mentioned in [1] that extending the version check regex to
allow suffixes would be nice. The regex in [1] only allows suffixes
starting with +, but Debian Policy [2], Section 5.6.12.2, also
mentions ~. Therefore, something like the following regex might be
better:
my $package_version_re = qr/\(pve-qemu-kvm_(\d+\.\d+(\.\d+)?-\d+)([+~][a-zA-Z0-9~]+)?\)/;
But since this works as advertized, consider:
Tested-by: Lukas Sichert <l.sichert@proxmox.com>
If no bigger changes are made, feel free to use my Tested-by in a future version.
[1] https://lore.proxmox.com/all/DKTOJDG9FQ00.31RUAI1TR35Y2@proxmox.com/T/#m38e4cd2377a01db1d090c946122b90f9e7f8ded1
[2] https://www.debian.org/doc/debian-policy/policy.pdf
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol
2026-08-20 9:56 ` [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Lukas Sichert
@ 2026-08-20 12:07 ` Thomas Lamprecht
2026-08-20 12:36 ` Christian Ebner
0 siblings, 1 reply; 12+ messages in thread
From: Thomas Lamprecht @ 2026-08-20 12:07 UTC (permalink / raw)
To: Christian Ebner, Lukas Sichert; +Cc: pve-devel
On 20/08/2026 11:56, Lukas Sichert wrote:
> On 2026-08-20 11:05, Christian Ebner <c.ebner@proxmox.com> wrote:
>
>> This patch series skips writing to the host page cache for restores
>> to zvols, with the intention to avoid potential I/O delay issues for
>> other ZFS-backed VMs during page writeback on certain setups, as
>> reported in enterprise support and reproduced internally.
>>
>> This patch series adds an optional no-cache parameter for pbs-restore
>> command invocation, setting the BDRV_O_NOCACHE flag for the block
>> device being restored to and sets `cache=none` for vma restores.
>
> When I test patched debs on my testmachines I normally bump the version
> with a local<x> suffigx. package_name_1.2.3 is deployed as
> package_name_1.2.3+local1. When starting a restore with this and v2, I got
> the error 'TASK ERROR: internal error: cannot check version of invalid
> string 'unknown' at /usr/share/perl5/PVE/QemuServer/Helpers.pm line 104.'
>
> Christian proposed the following diff off-list, which worked for me.
>
> diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
> index 5065a457..1ed48a3b 100644
> --- a/src/PVE/QemuServer/Helpers.pm
> +++ b/src/PVE/QemuServer/Helpers.pm
> @@ -68,7 +68,7 @@ sub kvm_user_version {
> $kvm_mtime->{$binary} = $st->mtime;
>
> my $binary_version_re = qr/(\d+\.\d+(\.\d+)?)(\.\d+)?/;
> - my $package_version_re = qr/\(pve-qemu-kvm_(\d+\.\d+(\.\d+)?-\d+)\)/;
> + my $package_version_re = qr/\(pve-qemu-kvm_(\d+\.\d+(\.\d+)?-\d+)(\+[a-zA-Z0-9]+)?\)/;
>
> my $code = sub {
> my $line = shift;
>
> I wouldn't consider this a blocker, but it would be a nice to have in a
> potential next version.
meh, that's far from great - re-implementing all off debians
package version seems also futile and hard to maintain; so either
we use "dpkg --compare-versions ..." directly via run_command or
just bump the versioned dependency in d/control here - even though
the latter makes downgrading slightly more work, it is IMO still more
preferable for this here, and it would allow us to drop like three
patches FWICT.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol
2026-08-20 12:07 ` Thomas Lamprecht
@ 2026-08-20 12:36 ` Christian Ebner
0 siblings, 0 replies; 12+ messages in thread
From: Christian Ebner @ 2026-08-20 12:36 UTC (permalink / raw)
To: Thomas Lamprecht, Lukas Sichert; +Cc: pve-devel
On 8/20/26 2:07 PM, Thomas Lamprecht wrote:
> On 20/08/2026 11:56, Lukas Sichert wrote:
>> On 2026-08-20 11:05, Christian Ebner <c.ebner@proxmox.com> wrote:
>>
>>> This patch series skips writing to the host page cache for restores
>>> to zvols, with the intention to avoid potential I/O delay issues for
>>> other ZFS-backed VMs during page writeback on certain setups, as
>>> reported in enterprise support and reproduced internally.
>>>
>>> This patch series adds an optional no-cache parameter for pbs-restore
>>> command invocation, setting the BDRV_O_NOCACHE flag for the block
>>> device being restored to and sets `cache=none` for vma restores.
>>
>> When I test patched debs on my testmachines I normally bump the version
>> with a local<x> suffigx. package_name_1.2.3 is deployed as
>> package_name_1.2.3+local1. When starting a restore with this and v2, I got
>> the error 'TASK ERROR: internal error: cannot check version of invalid
>> string 'unknown' at /usr/share/perl5/PVE/QemuServer/Helpers.pm line 104.'
>>
>> Christian proposed the following diff off-list, which worked for me.
>>
>> diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
>> index 5065a457..1ed48a3b 100644
>> --- a/src/PVE/QemuServer/Helpers.pm
>> +++ b/src/PVE/QemuServer/Helpers.pm
>> @@ -68,7 +68,7 @@ sub kvm_user_version {
>> $kvm_mtime->{$binary} = $st->mtime;
>>
>> my $binary_version_re = qr/(\d+\.\d+(\.\d+)?)(\.\d+)?/;
>> - my $package_version_re = qr/\(pve-qemu-kvm_(\d+\.\d+(\.\d+)?-\d+)\)/;
>> + my $package_version_re = qr/\(pve-qemu-kvm_(\d+\.\d+(\.\d+)?-\d+)(\+[a-zA-Z0-9]+)?\)/;
>>
>> my $code = sub {
>> my $line = shift;
>>
>> I wouldn't consider this a blocker, but it would be a nice to have in a
>> potential next version.
>
>
> meh, that's far from great - re-implementing all off debians
> package version seems also futile and hard to maintain; so either
> we use "dpkg --compare-versions ..." directly via run_command or
> just bump the versioned dependency in d/control here - even though
> the latter makes downgrading slightly more work, it is IMO still more
> preferable for this here, and it would allow us to drop like three
> patches FWICT.
Okay, will drop the 3 version check helper patches then and bump the
dependency instead for v4.
Thanks!
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol
2026-08-20 9:05 [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Christian Ebner
` (7 preceding siblings ...)
2026-08-20 11:36 ` Lukas Sichert
@ 2026-08-20 13:12 ` Christian Ebner
8 siblings, 0 replies; 12+ messages in thread
From: Christian Ebner @ 2026-08-20 13:12 UTC (permalink / raw)
To: pve-devel
superseded-by version 4:
https://lore.proxmox.com/pve-devel/20260820131049.374072-1-c.ebner@proxmox.com/T/
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-08-20 13:12 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 9:05 [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Christian Ebner
2026-08-20 9:05 ` [PATCH v3 pve-qemu 1/1] pbs-restore: add optional no-cache flag to bypass host page cache Christian Ebner
2026-08-20 9:05 ` [PATCH v3 qemu-server 2/6] helpers: never cache `unknown` on failed kvm binary version check Christian Ebner
2026-08-20 9:05 ` [PATCH v3 qemu-server 3/6] helpers: optionally get package version for kvm_user_version() Christian Ebner
2026-08-20 9:05 ` [PATCH v3 qemu-server 4/6] helpers: add helper for min kvm package version comparison Christian Ebner
2026-08-20 9:05 ` [PATCH v3 qemu-server 5/6] pbs-restore: set 'no-cache' on block devices backed by zfspool Christian Ebner
2026-08-20 9:05 ` [PATCH v3 qemu-server 6/6] vma restore: skip page cache " Christian Ebner
2026-08-20 9:56 ` [PATCH v3 pve-qemu qemu-server 0/6] bypass host page cache for restore on zvol Lukas Sichert
2026-08-20 12:07 ` Thomas Lamprecht
2026-08-20 12:36 ` Christian Ebner
2026-08-20 11:36 ` Lukas Sichert
2026-08-20 13:12 ` Christian Ebner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.