public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: Enrico Plantulli <plantulli@gmail.com>, pbs-devel@lists.proxmox.com
Subject: Re: [PATCH v2 proxmox 1/3] pbs-api-types: add gc chunk metadata prefetch tuning options
Date: Fri, 14 Aug 2026 16:34:34 +0200	[thread overview]
Message-ID: <7d91d14b-bc60-408f-817f-22040abf7eb4@proxmox.com> (raw)
In-Reply-To: <20260811093722.735290-2-plantulli@gmail.com>

On 8/11/26 11:37 AM, Enrico Plantulli wrote:
> Add an opt-in option to defer and batch chunk access time updates in
> garbage collection phase 1, plus a separate option for the batch size
> to ease benchmarking on different storage backends.

comment: The same option can be used here for both, opting in and 
defining the batch size. If the optional parameter is not set, this 
should simply imply fallback to the default atime update logic. This 
helps reduce code lines, config sizes and parsing overhead.

> Batched updates are flushed sorted by digest, so the chunk directories
> involved can be warmed via readdir right before their chunks are
> touched. Keeping the switch opt-in follows the review of the first
> version of this series: storage backends that do not prefetch inode
> metadata on readdir, such as some network attached storages, may see
> no benefit or a regression.

nit: The commit message does not need to contain review history and best 
kept on-point. I would rather prefer an additional reasoning for the 
chosen default, minimum and maximum values here.

> Signed-off-by: Enrico Plantulli <plantulli@gmail.com>
> ---
>   pbs-api-types/src/datastore.rs | 24 ++++++++++++++++++++++++
>   1 file changed, 24 insertions(+)
> 
> diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
> index 93ccaf0..79ccff9 100644
> --- a/pbs-api-types/src/datastore.rs
> +++ b/pbs-api-types/src/datastore.rs
> @@ -256,6 +256,14 @@ pub const GC_CACHE_CAPACITY_SCHEMA: Schema =
>           .default(1024 * 1024)
>           .schema();
>   
> +pub const GC_PREFETCH_BATCH_SIZE_SCHEMA: Schema = IntegerSchema::new(
> +    "Batch size for deferred chunk access time updates in garbage collection phase 1",
> +)
> +.minimum(1024)
> +.maximum(16 * 1024 * 1024)

nit: adding some reasoning to the commit

> +.default(1024 * 1024)
> +.schema();
> +
>   #[api(
>       properties: {
>           "chunk-order": {
> @@ -278,6 +286,18 @@ pub const GC_CACHE_CAPACITY_SCHEMA: Schema =
>               schema: GC_CACHE_CAPACITY_SCHEMA,
>               optional: true,
>           },
> +        "gc-chunk-metadata-prefetch": {
> +            description:
> +                "Defer and batch chunk access time updates in garbage collection phase 1, \
> +                warming each chunk directory via readdir right before its chunks are touched",

nit: this is an user facing description, how exactly the caches are 
warmed is an implementation detail so I suggest to not include that 
part, but rather keep this a bit more concise, but this unneeded option
should be dropped in favor of the other option anyways.

> +            optional: true,
> +            default: false,
> +            type: bool,
> +        },
> +        "gc-prefetch-batch-size": {
> +            schema: GC_PREFETCH_BATCH_SIZE_SCHEMA,
> +            optional: true,
> +        },
>           "default-verification-workers": {
>               schema: VERIFY_JOB_VERIFY_THREADS_SCHEMA,
>               optional: true,
> @@ -304,6 +324,10 @@ 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 gc_prefetch_batch_size: Option<usize>,
> +    #[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





  reply	other threads:[~2026-08-14 14:34 UTC|newest]

Thread overview: 16+ 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 ` [PATCH proxmox 1/3] pbs-api-types: add gc chunk metadata prefetch tuning option Enrico Plantulli
2026-08-10  5:01 ` [PATCH proxmox-backup 2/3] datastore: gc: optionally prefetch chunk metadata before phase 1 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
2026-08-10 20:32   ` Enrico Plant
2026-08-11  8:23     ` Christian Ebner
2026-08-11  9:37 ` [PATCH v2 proxmox proxmox-backup 0/3] datastore: gc: defer and batch chunk atime updates Enrico Plantulli
2026-08-11  9:37   ` [PATCH v2 proxmox 1/3] pbs-api-types: add gc chunk metadata prefetch tuning options Enrico Plantulli
2026-08-14 14:34     ` Christian Ebner [this message]
2026-08-11  9:37   ` [PATCH v2 proxmox-backup 2/3] datastore: gc: optionally defer and batch chunk atime updates Enrico Plantulli
2026-08-14 14:34     ` Christian Ebner
2026-08-11  9:37   ` [PATCH v2 proxmox-backup 3/3] ui: tuning: add GC chunk metadata prefetch options Enrico Plantulli
2026-08-14 14:48   ` [PATCH v2 proxmox proxmox-backup 0/3] datastore: gc: defer and batch chunk atime updates 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=7d91d14b-bc60-408f-817f-22040abf7eb4@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=plantulli@gmail.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal