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 590EF1FF135 for ; Thu, 02 Jul 2026 17:00:30 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 1BCB321494; Thu, 02 Jul 2026 17:00:30 +0200 (CEST) From: Robert Obkircher To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup v2 07/13] task tracking: only read starttime when needed Date: Thu, 2 Jul 2026 16:59:04 +0200 Message-ID: <20260702145916.360488-8-r.obkircher@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260702145916.360488-1-r.obkircher@proxmox.com> References: <20260702145916.360488-1-r.obkircher@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1783004419957 X-SPAM-LEVEL: Spam detection results: 0 DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) 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: PEHSGFFIW6MWZSCXKP3BSGFZXOLBZR63 X-Message-ID-Hash: PEHSGFFIW6MWZSCXKP3BSGFZXOLBZR63 X-MailFrom: r.obkircher@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 Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Avoid an extra pidstat call in the common case. Signed-off-by: Robert Obkircher --- pbs-datastore/src/task_tracking.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pbs-datastore/src/task_tracking.rs b/pbs-datastore/src/task_tracking.rs index d4cc076aa..528ac8c18 100644 --- a/pbs-datastore/src/task_tracking.rs +++ b/pbs-datastore/src/task_tracking.rs @@ -101,7 +101,6 @@ pub fn update_active_operations( let (_lock, options) = open_lock_file(name)?; let pid = std::process::id(); - let starttime = procfs::PidStat::read_from_pid(Pid::from_raw(pid as pid_t))?.starttime; let mut updated_active_operations = match operation { Operation::Read => ActiveOperationStats { read: 1, write: 0 }, @@ -137,7 +136,7 @@ pub fn update_active_operations( if !found_entry { updated_tasks.push(TaskOperations { pid, - starttime, + starttime: procfs::PidStat::read_from_pid(Pid::from_raw(pid as pid_t))?.starttime, active_operations: updated_active_operations, }) } -- 2.47.3