From: Nicolas Frey <n.frey@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v2 1/6] datastore: add new thread settings to tuning options
Date: Mon, 24 Nov 2025 12:04:22 +0100 [thread overview]
Message-ID: <20251124110427.194887-3-n.frey@proxmox.com> (raw)
In-Reply-To: <20251124110427.194887-1-n.frey@proxmox.com>
add a new field to the `DataStoreImpl` to store the verify job thread
configuration from the tuning options
Reviewed-by: Christian Ebner <c.ebner@proxmox.com>
Tested-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Nicolas Frey <n.frey@proxmox.com>
---
Changes since v1:
* make the `new` fn not pub
* add docstring to `thread_settings` fn
pbs-datastore/src/datastore.rs | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index 65299cca..8d3dff4d 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -153,6 +153,7 @@ pub struct DataStoreImpl {
sync_level: DatastoreFSyncLevel,
backend_config: DatastoreBackendConfig,
lru_store_caching: Option<LocalDatastoreLruCache>,
+ thread_settings: DatastoreThreadSettings,
}
impl DataStoreImpl {
@@ -169,6 +170,7 @@ impl DataStoreImpl {
sync_level: Default::default(),
backend_config: Default::default(),
lru_store_caching: None,
+ thread_settings: Default::default(),
})
}
}
@@ -263,6 +265,27 @@ impl DatastoreBackend {
}
}
+#[derive(Clone, Default)]
+/// Amount of threads to use for certain jobs in a datastore.
+pub struct DatastoreThreadSettings {
+ /// # of threads to use to verify in verify job
+ pub verify_job_verify_threads: Option<usize>,
+ /// # of threads to use to read in verify job
+ pub verify_job_read_threads: Option<usize>,
+}
+
+impl DatastoreThreadSettings {
+ fn new(
+ verify_job_verify_threads: Option<usize>,
+ verify_job_read_threads: Option<usize>,
+ ) -> Self {
+ Self {
+ verify_job_verify_threads,
+ verify_job_read_threads,
+ }
+ }
+}
+
impl DataStore {
// This one just panics on everything
#[doc(hidden)]
@@ -545,6 +568,11 @@ impl DataStore {
None
};
+ let thread_settings = DatastoreThreadSettings::new(
+ tuning.default_verification_workers,
+ tuning.default_verification_readers,
+ );
+
Ok(DataStoreImpl {
chunk_store,
gc_mutex: Mutex::new(None),
@@ -555,6 +583,7 @@ impl DataStore {
sync_level: tuning.sync_level.unwrap_or_default(),
backend_config,
lru_store_caching,
+ thread_settings,
})
}
@@ -654,6 +683,11 @@ impl DataStore {
self.inner.chunk_store.base_path()
}
+ /// Returns the thread settings for this datastore
+ pub fn thread_settings(&self) -> &DatastoreThreadSettings {
+ &self.inner.thread_settings
+ }
+
/// Returns the absolute path for a backup namespace on this datastore
pub fn namespace_path(&self, ns: &BackupNamespace) -> PathBuf {
let mut path = self.base_path();
--
2.47.3
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2025-11-24 11:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 11:04 [pbs-devel] [PATCH proxmox{, -backup} v2 0/7] tuning: verify: add verify job thread options Nicolas Frey
2025-11-24 11:04 ` [pbs-devel] [PATCH proxmox v2 1/1] pbs-api-types: add default-verification-{workers, readers} to tuning options Nicolas Frey
2025-11-24 11:04 ` Nicolas Frey [this message]
2025-11-24 11:04 ` [pbs-devel] [PATCH proxmox-backup v2 2/6] verify: use tuning options' thread settings for {verify, read}-threads Nicolas Frey
2025-11-24 11:04 ` [pbs-devel] [PATCH proxmox-backup v2 3/6] ui: tuning: make default-verification-{workers, readers} configurable Nicolas Frey
2025-11-24 11:04 ` [pbs-devel] [PATCH proxmox-backup v2 4/6] ui: tuning: render verification threads in tuning options Nicolas Frey
2025-11-24 11:04 ` [pbs-devel] [PATCH proxmox-backup v2 5/6] ui: verify: fetch default {read, verify} thread values from " Nicolas Frey
2025-11-24 11:04 ` [pbs-devel] [PATCH proxmox-backup v2 6/6] docs: tuning: document default-verification-{workers, readers} Nicolas Frey
2025-11-24 12:41 ` [pbs-devel] [PATCH proxmox{, -backup} v2 0/7] tuning: verify: add verify job thread options Christian Ebner
2025-11-24 14:16 ` [pbs-devel] applied: " Thomas Lamprecht
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=20251124110427.194887-3-n.frey@proxmox.com \
--to=n.frey@proxmox.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