* [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol
@ 2026-08-19 14:46 Christian Ebner
2026-08-19 14:46 ` [PATCH v2 pve-qemu 1/5] add optional no-cache flag to bypass host page cache on pbs-restore Christian Ebner
` (6 more replies)
0 siblings, 7 replies; 11+ messages in thread
From: Christian Ebner @ 2026-08-19 14:46 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):
add optional no-cache flag to bypass host page cache on pbs-restore
...no-cache-flag-to-skip-host-page-cach.patch | 64 +++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 65 insertions(+)
create mode 100644 debian/patches/pve/0047-pbs-restore-add-no-cache-flag-to-skip-host-page-cach.patch
qemu-server:
Christian Ebner (4):
helpers: optionally get package version for kvm_user_version()
helpers: add helper for min 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 | 25 +++++++++++++++++++++-
src/PVE/QemuServer/Helpers.pm | 40 ++++++++++++++++++++++++++++-------
2 files changed, 56 insertions(+), 9 deletions(-)
--
2.47.3
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 pve-qemu 1/5] add optional no-cache flag to bypass host page cache on pbs-restore
2026-08-19 14:46 [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol Christian Ebner
@ 2026-08-19 14:46 ` Christian Ebner
2026-08-19 16:44 ` Fiona Ebner
2026-08-19 14:46 ` [PATCH v2 qemu-server 2/5] helpers: optionally get package version for kvm_user_version() Christian Ebner
` (5 subsequent siblings)
6 siblings, 1 reply; 11+ messages in thread
From: Christian Ebner @ 2026-08-19 14:46 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
changes:
- no changes
...no-cache-flag-to-skip-host-page-cach.patch | 64 +++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 65 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..435aab3
--- /dev/null
+++ b/debian/patches/pve/0047-pbs-restore-add-no-cache-flag-to-skip-host-page-cach.patch
@@ -0,0 +1,64 @@
+From 0000000000000000000000000000000000000000 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 like restoring to ZVOLs where page writeback can cause I/O
+delay issues in other ZFS-backed VMs on certain setups.
+
+Keeping it opt-in for full backwards compatibility, allowing to only
+enable it on targets where required.
+
+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));
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] 11+ messages in thread
* [PATCH v2 qemu-server 2/5] helpers: optionally get package version for kvm_user_version()
2026-08-19 14:46 [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol Christian Ebner
2026-08-19 14:46 ` [PATCH v2 pve-qemu 1/5] add optional no-cache flag to bypass host page cache on pbs-restore Christian Ebner
@ 2026-08-19 14:46 ` Christian Ebner
2026-08-19 16:37 ` Fiona Ebner
2026-08-19 14:46 ` [PATCH v2 qemu-server 3/5] helpers: add helper for min package version comparison Christian Ebner
` (4 subsequent siblings)
6 siblings, 1 reply; 11+ messages in thread
From: Christian Ebner @ 2026-08-19 14:46 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.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
changes:
- new in version 2
src/PVE/QemuServer/Helpers.pm | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
index dd17eef5..658400f2 100644
--- a/src/PVE/QemuServer/Helpers.pm
+++ b/src/PVE/QemuServer/Helpers.pm
@@ -53,30 +53,40 @@ 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 $kvm_user_version->{$binary}
- && $cachedmtime == $st->mtime;
+ my $version_type = $query_package_version ? 'package' : 'version';
+ if ($kvm_user_version->{$binary}->{$version_type} && $cachedmtime == $st->mtime) {
+ return $kvm_user_version->{$binary}->{$version_type};
+ }
- $kvm_user_version->{$binary} = 'unknown';
+ $kvm_user_version->{$binary} = {
+ version => 'unknown',
+ package => 'unknown',
+ };
$kvm_mtime->{$binary} = $st->mtime;
+ my $version_regex = '(\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 $version_regex[,\s]\(pve-qemu-kvm_($version_regex-\d+)\)/
+ ) {
+ $kvm_user_version->{$binary} = {
+ version => $2,
+ package => $5,
+ };
}
};
eval { PVE::Tools::run_command([$binary, '--version'], outfunc => $code); };
warn $@ if $@;
- return $kvm_user_version->{$binary};
+ return $kvm_user_version->{$binary}->{$version_type};
}
# Paths and directories
--
2.47.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 qemu-server 3/5] helpers: add helper for min package version comparison
2026-08-19 14:46 [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol Christian Ebner
2026-08-19 14:46 ` [PATCH v2 pve-qemu 1/5] add optional no-cache flag to bypass host page cache on pbs-restore Christian Ebner
2026-08-19 14:46 ` [PATCH v2 qemu-server 2/5] helpers: optionally get package version for kvm_user_version() Christian Ebner
@ 2026-08-19 14:46 ` Christian Ebner
2026-08-19 16:37 ` Fiona Ebner
2026-08-19 14:46 ` [PATCH v2 qemu-server 4/5] pbs-restore: set 'no-cache' on block devices backed by zfspool Christian Ebner
` (3 subsequent siblings)
6 siblings, 1 reply; 11+ messages in thread
From: Christian Ebner @ 2026-08-19 14:46 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:
- new in version 2
src/PVE/QemuServer/Helpers.pm | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
index 658400f2..860c0a9c 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
+ min_package_version
);
my $nodename = PVE::INotify::nodename();
@@ -89,6 +90,19 @@ sub kvm_user_version {
return $kvm_user_version->{$binary}->{$version_type};
}
+sub min_package_version {
+ my ($verstr, $major, $minor, $patch, $subver, $rel) = @_;
+
+ if ($verstr =~ m/^(\d+)\.(\d+)(?:\.(\d+))?(?:\.(\d+))?-(\d+)/) {
+ return 1
+ if version_cmp($1, $major, $2, $minor, $3 // 0, $patch, $4 // 0, $subver, $5, $rel) >=
+ 0;
+ return 0;
+ }
+
+ die "internal error: cannot check version of invalid string '$verstr'";
+}
+
# 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] 11+ messages in thread
* [PATCH v2 qemu-server 4/5] pbs-restore: set 'no-cache' on block devices backed by zfspool
2026-08-19 14:46 [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol Christian Ebner
` (2 preceding siblings ...)
2026-08-19 14:46 ` [PATCH v2 qemu-server 3/5] helpers: add helper for min package version comparison Christian Ebner
@ 2026-08-19 14:46 ` Christian Ebner
2026-08-19 14:46 ` [PATCH v2 qemu-server 5/5] vma restore: skip page cache " Christian Ebner
` (2 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Christian Ebner @ 2026-08-19 14:46 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:
- add version check for compatible pbs-restore by using pve-qemu
package version
- added comment to extend this to other storage types in the future
- hinted further that page writeback only kicks in after buffers are
filled
src/PVE/QemuServer.pm | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 2f43faa7..b0edbbe6 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -7090,6 +7090,20 @@ 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);
+
+ my $kvm_package_version = kvm_user_version(undef, 1);
+
+ if (
+ PVE::QemuServer::Helpers::min_package_version(
+ $kvm_package_version, 11, 0, 3, 0, 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] 11+ messages in thread
* [PATCH v2 qemu-server 5/5] vma restore: skip page cache on block devices backed by zfspool
2026-08-19 14:46 [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol Christian Ebner
` (3 preceding siblings ...)
2026-08-19 14:46 ` [PATCH v2 qemu-server 4/5] pbs-restore: set 'no-cache' on block devices backed by zfspool Christian Ebner
@ 2026-08-19 14:46 ` Christian Ebner
2026-08-19 16:44 ` [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol Jonas Theisen
2026-08-20 9:06 ` Christian Ebner
6 siblings, 0 replies; 11+ messages in thread
From: Christian Ebner @ 2026-08-19 14:46 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:
- fix formatting by invoking `make tidy`
- added comment to extend this to other storage types in the future
- hinted further that page writeback only kicks in after buffers are
filled
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 b0edbbe6..01af9447 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -7681,8 +7681,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] 11+ messages in thread
* Re: [PATCH v2 qemu-server 3/5] helpers: add helper for min package version comparison
2026-08-19 14:46 ` [PATCH v2 qemu-server 3/5] helpers: add helper for min package version comparison Christian Ebner
@ 2026-08-19 16:37 ` Fiona Ebner
0 siblings, 0 replies; 11+ messages in thread
From: Fiona Ebner @ 2026-08-19 16:37 UTC (permalink / raw)
To: Christian Ebner, pve-devel
Am 19.08.26 um 4:46 PM schrieb Christian Ebner:
> 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:
> - new in version 2
>
> src/PVE/QemuServer/Helpers.pm | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
> index 658400f2..860c0a9c 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
> + min_package_version
> );
>
> my $nodename = PVE::INotify::nodename();
> @@ -89,6 +90,19 @@ sub kvm_user_version {
> return $kvm_user_version->{$binary}->{$version_type};
> }
>
> +sub min_package_version {
I'd rather have the helper be binary_package_version_at_least() and take
the $binary instead of $verstr. It can call kvm_user_version itself.
Then there is less potential for somebody to pass along the wrong kind
of version.
> + my ($verstr, $major, $minor, $patch, $subver, $rel) = @_;
s/$patch/$micro/
No need for $subver, see the previous patch
> +
> + if ($verstr =~ m/^(\d+)\.(\d+)(?:\.(\d+))?(?:\.(\d+))?-(\d+)/) {
> + return 1
> + if version_cmp($1, $major, $2, $minor, $3 // 0, $patch, $4 // 0, $subver, $5, $rel) >=
> + 0;
Style nit: multi-line post-if
> + return 0;
> + }
> +
> + die "internal error: cannot check version of invalid string '$verstr'";
> +}
> +
> # Paths and directories
>
> # FIXME: MAJOR VERSION: use /run/qemu-server everywhere instead of mixing /run and /var/run and rely
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 qemu-server 2/5] helpers: optionally get package version for kvm_user_version()
2026-08-19 14:46 ` [PATCH v2 qemu-server 2/5] helpers: optionally get package version for kvm_user_version() Christian Ebner
@ 2026-08-19 16:37 ` Fiona Ebner
0 siblings, 0 replies; 11+ messages in thread
From: Fiona Ebner @ 2026-08-19 16:37 UTC (permalink / raw)
To: Christian Ebner, pve-devel
Am 19.08.26 um 4:47 PM schrieb Christian Ebner:
> 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.
>
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
> ---
> changes:
> - new in version 2
>
> src/PVE/QemuServer/Helpers.pm | 26 ++++++++++++++++++--------
> 1 file changed, 18 insertions(+), 8 deletions(-)
>
> diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
> index dd17eef5..658400f2 100644
> --- a/src/PVE/QemuServer/Helpers.pm
> +++ b/src/PVE/QemuServer/Helpers.pm
> @@ -53,30 +53,40 @@ 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 $kvm_user_version->{$binary}
> - && $cachedmtime == $st->mtime;
> + my $version_type = $query_package_version ? 'package' : 'version';
> + if ($kvm_user_version->{$binary}->{$version_type} && $cachedmtime == $st->mtime) {
Pre-existing, but a definedness check would be slightly nicer. I'd also
only check for $kvm_user_version->{$binary} if making the package match
optional (see my comment below).
> + return $kvm_user_version->{$binary}->{$version_type};
> + }
>
> - $kvm_user_version->{$binary} = 'unknown';
> + $kvm_user_version->{$binary} = {
> + version => 'unknown',
> + package => 'unknown',
> + };
Pre-existing, but like this the values will be initialized even if the
version command later fails for some reason and then they will stay
'unknown'. I'd rather re-attempt the query instead.
> $kvm_mtime->{$binary} = $st->mtime;
>
> + my $version_regex = '(\d+\.\d+(\.\d+)?)(\.\d+)?';
Nit: could compile the regex with qr already
Nit: $version_re is a bit shorter which helps in a longer regex.
Nit: could also add a second $package_re
For the package I wouldn't even match the last number, because that
cannot be defined: in debian/rules we use
--with-pkgversion="${DEB_SOURCE}_${DEB_VERSION_UPSTREAM_REVISION}
and we only use major.minor.micro-rel
> 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 $version_regex[,\s]\(pve-qemu-kvm_($version_regex-\d+)\)/
I would make the latter half of the regex an optional match, just
because we didn't require it before.
> + ) {
> + $kvm_user_version->{$binary} = {
> + version => $2,
> + package => $5,
> + };
> }
> };
>
> eval { PVE::Tools::run_command([$binary, '--version'], outfunc => $code); };
> warn $@ if $@;
>
> - return $kvm_user_version->{$binary};
> + return $kvm_user_version->{$binary}->{$version_type};
> }
>
> # Paths and directories
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 pve-qemu 1/5] add optional no-cache flag to bypass host page cache on pbs-restore
2026-08-19 14:46 ` [PATCH v2 pve-qemu 1/5] add optional no-cache flag to bypass host page cache on pbs-restore Christian Ebner
@ 2026-08-19 16:44 ` Fiona Ebner
0 siblings, 0 replies; 11+ messages in thread
From: Fiona Ebner @ 2026-08-19 16:44 UTC (permalink / raw)
To: Christian Ebner, pve-devel
I'd move the pbs-restore as a prefix to the front in the title, i.e.
pbs-restore: add optional ...
Am 19.08.26 um 4:47 PM schrieb Christian Ebner:
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
with one more comment below
> ---
> changes:
> - no changes
>
> ...no-cache-flag-to-skip-host-page-cach.patch | 64 +++++++++++++++++++
> debian/patches/series | 1 +
> 2 files changed, 65 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..435aab3
> --- /dev/null
> +++ b/debian/patches/pve/0047-pbs-restore-add-no-cache-flag-to-skip-host-page-cach.patch
> @@ -0,0 +1,64 @@
> +From 0000000000000000000000000000000000000000 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 like restoring to ZVOLs where page writeback can cause I/O
> +delay issues in other ZFS-backed VMs on certain setups.
Here you could go a bit more into detail and maybe also provide a
reference to the issues
> +
> +Keeping it opt-in for full backwards compatibility, allowing to only
> +enable it on targets where required.
> +
> +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));
> 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol
2026-08-19 14:46 [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol Christian Ebner
` (4 preceding siblings ...)
2026-08-19 14:46 ` [PATCH v2 qemu-server 5/5] vma restore: skip page cache " Christian Ebner
@ 2026-08-19 16:44 ` Jonas Theisen
2026-08-20 9:06 ` Christian Ebner
6 siblings, 0 replies; 11+ messages in thread
From: Jonas Theisen @ 2026-08-19 16:44 UTC (permalink / raw)
To: pve-devel
On 8/19/26 16:46, Christian Ebner 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`.
>
> [snip]
Tested this patch on a lab host with a restore from PBS on the same host.
Seeing no relevant I/O delays on a zvol on the same pool.
VMs hosted on the same pool also experience only marginal delays.
--
Tested-by: Jonas Theisen <j.theisen@proxmox.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol
2026-08-19 14:46 [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol Christian Ebner
` (5 preceding siblings ...)
2026-08-19 16:44 ` [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol Jonas Theisen
@ 2026-08-20 9:06 ` Christian Ebner
6 siblings, 0 replies; 11+ messages in thread
From: Christian Ebner @ 2026-08-20 9:06 UTC (permalink / raw)
To: pve-devel
superseded-by version 3:
https://lore.proxmox.com/pve-devel/20260820090528.117853-1-c.ebner@proxmox.com/T/
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-08-20 9:07 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 14:46 [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol Christian Ebner
2026-08-19 14:46 ` [PATCH v2 pve-qemu 1/5] add optional no-cache flag to bypass host page cache on pbs-restore Christian Ebner
2026-08-19 16:44 ` Fiona Ebner
2026-08-19 14:46 ` [PATCH v2 qemu-server 2/5] helpers: optionally get package version for kvm_user_version() Christian Ebner
2026-08-19 16:37 ` Fiona Ebner
2026-08-19 14:46 ` [PATCH v2 qemu-server 3/5] helpers: add helper for min package version comparison Christian Ebner
2026-08-19 16:37 ` Fiona Ebner
2026-08-19 14:46 ` [PATCH v2 qemu-server 4/5] pbs-restore: set 'no-cache' on block devices backed by zfspool Christian Ebner
2026-08-19 14:46 ` [PATCH v2 qemu-server 5/5] vma restore: skip page cache " Christian Ebner
2026-08-19 16:44 ` [PATCH v2 qemu-server 0/5] bypass host page cache for restore on zvol Jonas Theisen
2026-08-20 9:06 ` Christian Ebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox