Skip to content

Commit a810aeb

Browse files
committed
CP-53827, xenopsd: claim pages for domain on pre_build phase
This way xen can track the memory intended to be used for each domain and fail early, if necessary. This is done on numa_placement because the code is intended to change and do per-numa-node memory claims in the near future. Signed-off-by: Pau Ruiz Safont <[email protected]>
1 parent 3a8199e commit a810aeb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ocaml/xenopsd/xc/domain.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,15 +886,18 @@ let numa_placement domid ~vcpus ~memory =
886886
Softaffinity.plan ~vm host nodea
887887
)
888888
in
889-
match hint with
889+
let xcext = get_handle () in
890+
( match hint with
890891
| None ->
891892
D.debug "NUMA-aware placement failed for domid %d" domid
892893
| Some soft_affinity ->
893894
let cpua = CPUSet.to_mask soft_affinity in
894-
let xcext = get_handle () in
895895
for i = 0 to vcpus - 1 do
896896
Xenctrlext.vcpu_setaffinity_soft xcext domid i cpua
897897
done
898+
) ;
899+
let nr_pages = Int64.div memory 4096L |> Int64.to_int in
900+
Xenctrlext.domain_claim_pages xcext domid nr_pages
898901

899902
let build_pre ~xc ~xs ~vcpus ~memory ~has_hard_affinity domid =
900903
let open Memory in

0 commit comments

Comments
 (0)