From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 6D4451FF16B for ; Fri, 21 Nov 2025 15:15:32 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 17DFB2319C; Fri, 21 Nov 2025 15:15:40 +0100 (CET) Message-ID: Date: Fri, 21 Nov 2025 15:15:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Christian Ebner To: Proxmox Backup Server development discussion , Nicolas Frey References: <20251121123209.198368-1-n.frey@proxmox.com> <20251121123209.198368-3-n.frey@proxmox.com> Content-Language: en-US, de-DE In-Reply-To: <20251121123209.198368-3-n.frey@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1763734504922 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.048 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH proxmox-backup 1/4] datastore: add new thread settings to tuning options X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" On 11/21/25 1:31 PM, Nicolas Frey wrote: > add a new field to the `DataStoreImpl` to store the verify job thread > configuration from the tuning options > > Signed-off-by: Nicolas Frey > --- > pbs-datastore/src/datastore.rs | 33 +++++++++++++++++++++++++++++++++ > 1 file changed, 33 insertions(+) > > diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs > index 0a517923..fec9de78 100644 > --- a/pbs-datastore/src/datastore.rs > +++ b/pbs-datastore/src/datastore.rs > @@ -146,6 +146,7 @@ pub struct DataStoreImpl { > sync_level: DatastoreFSyncLevel, > backend_config: DatastoreBackendConfig, > lru_store_caching: Option, > + thread_settings: DatastoreThreadSettings, > } > > impl DataStoreImpl { > @@ -162,6 +163,7 @@ impl DataStoreImpl { > sync_level: Default::default(), > backend_config: Default::default(), > lru_store_caching: None, > + thread_settings: Default::default(), > }) > } > } > @@ -256,6 +258,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, > + /// # of threads to use to read in verify job > + pub verify_job_read_threads: Option, > +} > + > +impl DatastoreThreadSettings { > + pub fn new( nit: no need to make the constructor pub, this can be limited to the module scope. > + verify_job_verify_threads: Option, > + verify_job_read_threads: Option, > + ) -> Self { > + Self { > + verify_job_verify_threads, > + verify_job_read_threads, > + } > + } > +} > + > impl DataStore { > // This one just panics on everything > #[doc(hidden)] > @@ -532,6 +555,11 @@ impl DataStore { > None > }; > > + let thread_settings = DatastoreThreadSettings::new( > + tuning.verify_job_verify_threads, > + tuning.verify_job_read_threads, > + ); > + > Ok(DataStoreImpl { > chunk_store, > gc_mutex: Mutex::new(None), > @@ -542,6 +570,7 @@ impl DataStore { > sync_level: tuning.sync_level.unwrap_or_default(), > backend_config, > lru_store_caching, > + thread_settings, > }) > } > > @@ -641,6 +670,10 @@ impl DataStore { > self.inner.chunk_store.base_path() > } > > + pub fn thread_settings(&self) -> &DatastoreThreadSettings { > + &self.inner.thread_settings > + } > + nit: please add a short docstring for this method, although there are pre-existing methods without, we should add these moving forward > /// 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(); _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel