From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id CE1F11FF0A7 for ; Wed, 19 Aug 2026 18:44:50 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 75F9B21541; Wed, 19 Aug 2026 18:44:48 +0200 (CEST) Message-ID: <45fd4982-bd2d-4cfe-a6e2-6fbe0df7e06e@proxmox.com> Date: Wed, 19 Aug 2026 18:44:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 pve-qemu 1/5] add optional no-cache flag to bypass host page cache on pbs-restore To: Christian Ebner , pve-devel@lists.proxmox.com References: <20260819144642.453513-1-c.ebner@proxmox.com> <20260819144642.453513-2-c.ebner@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20260819144642.453513-2-c.ebner@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787157860496 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.853 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: TG2NPLUYMVXBI4Y6OOMLULSX5IDEZJLH X-Message-ID-Hash: TG2NPLUYMVXBI4Y6OOMLULSX5IDEZJLH X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 Reviewed-by: Fiona Ebner 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 > +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 > +--- > + 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