Skip to content

Commit 9e6fb15

Browse files
committed
xenopsd/xc: Do not try to allocate pages to a particular NUMA node
Neither xenguest nor emu-manager support passing the parameter just yet, so avoid passing the numa node to create the parameter. On top of that claiming memory conflicts with DMC, so it's better to keep previous behaviour of not claiming any pages before allocating. Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
1 parent 6f6b638 commit 9e6fb15

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

ocaml/xenopsd/xc/domain.ml

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ let numa_placement domid ~vcpus ~memory =
880880
Array.map2 NUMAResource.min_memory (Array.of_list nodes) a
881881
in
882882
numa_resources := Some nodea ;
883-
let memory_plan =
883+
let _ =
884884
match Softaffinity.plan ~vm host nodea with
885885
| None ->
886886
D.debug "NUMA-aware placement failed for domid %d" domid ;
@@ -892,29 +892,10 @@ let numa_placement domid ~vcpus ~memory =
892892
done ;
893893
mem_plan
894894
in
895-
(* Xen only allows a single node when using memory claims, or none at all. *)
896-
let* numa_node, node =
897-
match memory_plan with
898-
| [Node node] ->
899-
Some (Xenctrlext.NumaNode.from node, node)
900-
| [] | _ :: _ :: _ ->
901-
D.debug
902-
"%s: domain %d can't fit a single NUMA node, falling back to \
903-
default behaviour"
904-
__FUNCTION__ domid ;
905-
None
906-
in
907-
let nr_pages = Int64.div memory 4096L |> Int64.to_int in
908-
try
909-
Xenctrlext.domain_claim_pages xcext domid ~numa_node nr_pages ;
910-
Some (node, memory)
911-
with Xenctrlext.Unix_error (errno, _) ->
912-
D.info
913-
"%s: unable to claim enough memory, domain %d won't be hosted in a \
914-
single NUMA node. (error %s)"
915-
__FUNCTION__ domid
916-
Unix.(error_message errno) ;
917-
None
895+
(* Neither xenguest nor emu-manager allow allocating pages to a single
896+
NUMA node, don't return any NUMA in any case. Claiming the memory
897+
would be done here, but it conflicts with DMC. *)
898+
None
918899
)
919900

920901
let build_pre ~xc ~xs ~vcpus ~memory ~has_hard_affinity domid =

0 commit comments

Comments
 (0)