* [PATCH v4 pve-qemu qemu-server 0/3] bypass host page cache for restore on zvol
@ 2026-08-20 13:10 Christian Ebner
2026-08-20 13:10 ` [PATCH v4 pve-qemu 1/3] pbs-restore: add optional no-cache flag to bypass host page cache Christian Ebner
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Christian Ebner @ 2026-08-20 13:10 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`.
qemu-server now depends on pve-qemu-kvm in version 11.0.3-3 in order to
use the new --no-cache flag for pbs-restore.
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 (2):
pbs-restore: set 'no-cache' on block devices backed by zfspool
vma restore: skip page cache on block devices backed by zfspool
debian/control | 2 +-
src/PVE/QemuServer.pm | 18 +++++++++++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v4 pve-qemu 1/3] pbs-restore: add optional no-cache flag to bypass host page cache
2026-08-20 13:10 [PATCH v4 pve-qemu qemu-server 0/3] bypass host page cache for restore on zvol Christian Ebner
@ 2026-08-20 13:10 ` Christian Ebner
2026-08-20 13:10 ` [PATCH v4 qemu-server 2/3] pbs-restore: set 'no-cache' on block devices backed by zfspool Christian Ebner
2026-08-20 13:10 ` [PATCH v4 qemu-server 3/3] vma restore: skip page cache " Christian Ebner
2 siblings, 0 replies; 5+ messages in thread
From: Christian Ebner @ 2026-08-20 13:10 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>
Tested-by: Lukas Sichert <l.sichert@proxmox.com>
---
changes since version 3:
- no changes
...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] 5+ messages in thread
* [PATCH v4 qemu-server 2/3] pbs-restore: set 'no-cache' on block devices backed by zfspool
2026-08-20 13:10 [PATCH v4 pve-qemu qemu-server 0/3] bypass host page cache for restore on zvol Christian Ebner
2026-08-20 13:10 ` [PATCH v4 pve-qemu 1/3] pbs-restore: add optional no-cache flag to bypass host page cache Christian Ebner
@ 2026-08-20 13:10 ` Christian Ebner
2026-08-21 7:44 ` Lukas Sichert
2026-08-20 13:10 ` [PATCH v4 qemu-server 3/3] vma restore: skip page cache " Christian Ebner
2 siblings, 1 reply; 5+ messages in thread
From: Christian Ebner @ 2026-08-20 13:10 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.
Version bump in d/control assures feature compatibility for
pbs-restore.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
changes since version 3:
- drop package version comparison checks
- bump d/control dependency for pve-qemu-kvm
debian/control | 2 +-
src/PVE/QemuServer.pm | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/debian/control b/debian/control
index 97049e1d..a9949d5a 100644
--- a/debian/control
+++ b/debian/control
@@ -61,7 +61,7 @@ Depends: conntrack,
pve-edk2-firmware-ovmf (>= 4.2025.05-2) [amd64],
pve-firewall (>= 6.0.3),
pve-ha-manager (>= 5.0.3),
- pve-qemu-kvm (>= 7.1~),
+ pve-qemu-kvm (>= 11.0.3-3),
python3-virt-firmware,
socat,
swtpm,
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 2f43faa7..317aeaac 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -7090,6 +7090,13 @@ 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 ($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] 5+ messages in thread
* [PATCH v4 qemu-server 3/3] vma restore: skip page cache on block devices backed by zfspool
2026-08-20 13:10 [PATCH v4 pve-qemu qemu-server 0/3] bypass host page cache for restore on zvol Christian Ebner
2026-08-20 13:10 ` [PATCH v4 pve-qemu 1/3] pbs-restore: add optional no-cache flag to bypass host page cache Christian Ebner
2026-08-20 13:10 ` [PATCH v4 qemu-server 2/3] pbs-restore: set 'no-cache' on block devices backed by zfspool Christian Ebner
@ 2026-08-20 13:10 ` Christian Ebner
2 siblings, 0 replies; 5+ messages in thread
From: Christian Ebner @ 2026-08-20 13:10 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: Lukas Sichert <l.sichert@proxmox.com>
---
changes since version 3:
- no changes
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 317aeaac..9c69d84f 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -7674,8 +7674,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] 5+ messages in thread
* Re: [PATCH v4 qemu-server 2/3] pbs-restore: set 'no-cache' on block devices backed by zfspool
2026-08-20 13:10 ` [PATCH v4 qemu-server 2/3] pbs-restore: set 'no-cache' on block devices backed by zfspool Christian Ebner
@ 2026-08-21 7:44 ` Lukas Sichert
0 siblings, 0 replies; 5+ messages in thread
From: Lukas Sichert @ 2026-08-21 7:44 UTC (permalink / raw)
To: Christian Ebner, pve-devel
On 2026-08-20 15:10, Christian Ebner <c.ebner@proxmox.com> wrote:
> 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.
>
> Version bump in d/control assures feature compatibility for
> pbs-restore.
>
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
When I tried to install qemu-server with pve-qemu-kvm at 11.0.3-2
APT aborted the installation due to unsatisfied dependencies.
With pve-qemu-kvm bumped to 11.0.3-3 the installation was possible
and the --no-cache flag was set correctly.
Also my +local suffixes did not create any issues.
Therefore, consider this:
Tested-by: Lukas Sichert <l.sichert@proxmox.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-08-21 7:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 13:10 [PATCH v4 pve-qemu qemu-server 0/3] bypass host page cache for restore on zvol Christian Ebner
2026-08-20 13:10 ` [PATCH v4 pve-qemu 1/3] pbs-restore: add optional no-cache flag to bypass host page cache Christian Ebner
2026-08-20 13:10 ` [PATCH v4 qemu-server 2/3] pbs-restore: set 'no-cache' on block devices backed by zfspool Christian Ebner
2026-08-21 7:44 ` Lukas Sichert
2026-08-20 13:10 ` [PATCH v4 qemu-server 3/3] vma restore: skip page cache " Christian Ebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox