From 9badc14ace3a64ad4f31850870215ac74400e627 Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Mon, 3 Feb 2025 16:33:49 +0000 Subject: [PATCH] topology: ignore unreachable nodes for upper limit of candidates' calculation Now unreachable nodes are not considered when calculating all the subsets for the NUMA nodes combinations for scheduling a domain. Signed-off-by: Pau Ruiz Safont --- ocaml/xenopsd/lib/topology.ml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ocaml/xenopsd/lib/topology.ml b/ocaml/xenopsd/lib/topology.ml index 719e4745da..f706f542d5 100644 --- a/ocaml/xenopsd/lib/topology.ml +++ b/ocaml/xenopsd/lib/topology.ml @@ -181,18 +181,22 @@ module NUMA = struct None ) in - let numa_nodes = Array.length d in + let numa_nodes = Seq.length valid_nodes in let nodes = - if numa_nodes > 16 then + if numa_nodes > 16 then ( (* Avoid generating too many candidates because of the exponential running time. We could do better here, e.g. by reducing the matrix *) + D.info + "%s: More than 16 valid NUMA nodes detected, considering only \ + individual nodes." + __FUNCTION__ ; valid_nodes |> Seq.map (fun i -> let self = d.(i).(i) in (distance_to_candidate self, Seq.return i) ) - else + ) else valid_nodes |> seq_all_subsets |> Seq.filter_map (node_distances d) in nodes