From: Enrico Plantulli <plantulli@gmail.com>
To: pbs-devel@lists.proxmox.com
Cc: Enrico Plantulli <plantulli@gmail.com>
Subject: [PATCH proxmox 1/3] pbs-api-types: add gc chunk metadata prefetch tuning option
Date: Mon, 10 Aug 2026 07:01:58 +0200 [thread overview]
Message-ID: <20260810050201.347124-2-plantulli@gmail.com> (raw)
In-Reply-To: <20260810050201.347124-1-plantulli@gmail.com>
Garbage collection phase 1 reaches each chunk by building its path from
the digest, so it never iterates the chunk directories. On file systems
that prefetch inode metadata while iterating a directory, that leaves a
large win unused: a single readdir pass over .chunks/ brings in the
metadata in bulk, while phase 1 on its own faults it in one chunk at a
time, in an order uncorrelated with the on-disk layout.
Add an opt-in tuning option so that garbage collection can do that pass
before phase 1. It defaults to false because the pass costs time on file
systems that do not prefetch inodes on readdir, and on datastores whose
metadata already fits in the cache.
Signed-off-by: Enrico Plantulli <plantulli@gmail.com>
---
pbs-api-types/src/datastore.rs | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index 93ccaf0..76ecc5b 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -278,6 +278,14 @@ pub const GC_CACHE_CAPACITY_SCHEMA: Schema =
schema: GC_CACHE_CAPACITY_SCHEMA,
optional: true,
},
+ "gc-chunk-metadata-prefetch": {
+ description:
+ "Iterate the chunk directories once before garbage collection phase 1, so the \
+ file system can fault in chunk metadata in bulk instead of one chunk at a time",
+ optional: true,
+ default: false,
+ type: bool,
+ },
"default-verification-workers": {
schema: VERIFY_JOB_VERIFY_THREADS_SCHEMA,
optional: true,
@@ -304,6 +312,8 @@ pub struct DatastoreTuning {
#[serde(skip_serializing_if = "Option::is_none")]
pub gc_cache_capacity: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
+ pub gc_chunk_metadata_prefetch: Option<bool>,
+ #[serde(skip_serializing_if = "Option::is_none")]
pub default_verification_workers: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
pub default_verification_readers: Option<usize>,
base-commit: e3e3ff11b9b92fe1ace89b84c1e15c150e2db660
--
2.47.3
next prev parent reply other threads:[~2026-08-10 5:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 5:01 [PATCH proxmox proxmox-backup 0/3] datastore: gc: prefetch chunk metadata before phase 1 Enrico Plantulli
2026-08-10 5:01 ` Enrico Plantulli [this message]
2026-08-10 5:01 ` [PATCH proxmox-backup 2/3] datastore: gc: optionally " Enrico Plantulli
2026-08-10 10:19 ` Christian Ebner
2026-08-10 15:05 ` Enrico Plantulli
2026-08-10 5:02 ` [PATCH proxmox-backup 3/3] ui: tuning: add GC chunk metadata prefetch option Enrico Plantulli
2026-08-10 10:13 ` [PATCH proxmox proxmox-backup 0/3] datastore: gc: prefetch chunk metadata before phase 1 Christian Ebner
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=20260810050201.347124-2-plantulli@gmail.com \
--to=plantulli@gmail.com \
--cc=pbs-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