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 E99131FF136 for ; Mon, 09 Mar 2026 14:39:00 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D532334960; Mon, 9 Mar 2026 14:38:51 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 09 Mar 2026 14:38:47 +0100 Message-Id: From: "Dominik Rusovac" To: "Daniel Kral" , Subject: Re: [RFC proxmox 2/5] resource-scheduling: introduce generic cluster usage implementation X-Mailer: aerc 0.20.0 References: <20260217141437.584852-1-d.kral@proxmox.com> <20260217141437.584852-3-d.kral@proxmox.com> In-Reply-To: <20260217141437.584852-3-d.kral@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773063495558 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.792 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 RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.408 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.819 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.903 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: 6J2M5OZ4LFGBDPAL4TBPQCU6RUS4D7O4 X-Message-ID-Hash: 6J2M5OZ4LFGBDPAL4TBPQCU6RUS4D7O4 X-MailFrom: d.rusovac@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 VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue Feb 17, 2026 at 3:13 PM CET, Daniel Kral wrote: > Declare generic NodeStats and ServiceStats structs, which special use > cases convert their types into, and use these to implement generic > scheduler methods such as the existing scoring of nodes to start a > previously non-running service. > > This is best viewed with the git option --ignore-all-space. > > Signed-off-by: Daniel Kral > --- [snip] > /// Scores candidate `nodes` to start a `service` on. Scoring is done ac= cording to the static memory > /// and CPU usages of the nodes as if the service would already be runni= ng on each. > /// > /// Returns a vector of (nodename, score) pairs. Scores are between 0.0 = and 1.0 and a higher score > /// is better. > +#[deprecated] It would be nice to provide a deprecation message, which mentions at least the preferred alternative function, via #[deprecated =3D "use ... instead"] > pub fn score_nodes_to_start_service>( > nodes: &[T], > service: &StaticServiceUsage, > ) -> Result, Error> { > - scheduler::score_nodes_to_start_service(nodes, service) > + let nodes =3D nodes > + .iter() > + .map(|node| node.as_ref().clone().into()) > + .collect::>(); > + > + let cluster_usage =3D ClusterUsage::from_nodes(nodes); > + > + cluster_usage.score_nodes_to_start_service(*service) > }