Skip to content

Commit b513269

Browse files
committed
more debug info
1 parent a4bc2bb commit b513269

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

ocaml/xenopsd/xc/domain.ml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,11 @@ let numa_placement domid ~vcpus ~cores ~memory affinity =
10291029
let build_pre ~xc ~xs ~vcpus ~memory ~hard_affinity domid =
10301030
let open Memory in
10311031
let uuid = get_uuid ~xc domid in
1032+
debug "VM = %s, build_max_mib = %Ld, build_start_mib = %Ld, xen_max_mib =
1033+
%Ld, shadow_mib = %Ld, required_host_free_mib = %Ld, overhead_mib = %Ld"
1034+
(Uuidx.to_string uuid)
1035+
memory.build_max_mib memory.build_start_mib memory.xen_max_mib
1036+
memory.shadow_mib memory.required_host_free_mib memory.overhead_mib;
10321037
debug "VM = %s; domid = %d; waiting for %Ld MiB of free host memory"
10331038
(Uuidx.to_string uuid) domid memory.required_host_free_mib ;
10341039
(* CA-39743: Wait, if necessary, for the Xen scrubber to catch up. *)

ocaml/xenopsd/xc/xenops_server_xen.ml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,6 +1830,7 @@ module VM = struct
18301830
let dbg = Xenops_task.get_dbg task in
18311831
Mem.with_reservation dbg min_kib max_kib
18321832
(fun target_plus_overhead_kib reservation_id ->
1833+
debug "VM = %s, memory [%Ld KiB, %Ld KiB], target_plus_overhead=%Ld KiB" vm.Vm.id min_kib max_kib target_plus_overhead_kib;
18331834
let domain_config, persistent =
18341835
match persistent.VmExtra.domain_config with
18351836
| Some dc ->
@@ -1870,6 +1871,7 @@ module VM = struct
18701871
let target_bytes =
18711872
target_plus_overhead_bytes --- overhead_bytes
18721873
in
1874+
debug "VM = %s, memory target_bytes = %Ld, dynamic max = %Ld" vm.Vm.id target_bytes vm.memory_dynamic_max;
18731875
min vm.memory_dynamic_max target_bytes
18741876
in
18751877
set_initial_target ~xs domid (Int64.div initial_target 1024L) ;
@@ -2967,6 +2969,7 @@ module VM = struct
29672969
| _ ->
29682970
""
29692971
in
2972+
debug "VM = %s, initial_target = %Ld" vm.Vm.id initial_target;
29702973
({x with Domain.memory_target= initial_target}, timeoffset)
29712974
in
29722975
let vtpm = vtpm_of ~vm in
@@ -3106,7 +3109,9 @@ module VM = struct
31063109
let memory_actual =
31073110
let pages = Int64.of_nativeint di.Xenctrl.total_memory_pages in
31083111
let kib = Xenctrl.pages_to_kib pages in
3109-
Memory.bytes_of_kib kib
3112+
let bytes = Memory.bytes_of_kib kib in
3113+
D.debug "VM %s memory actual: %Ld pages = %Ld KiB = %Ld bytes" (Uuidm.to_string uuid) pages kib bytes;
3114+
bytes
31103115
in
31113116
let memory_limit =
31123117
(* The maximum amount of memory the domain can consume is the max
@@ -3129,7 +3134,9 @@ module VM = struct
31293134
in
31303135
(* CA-31764: may be larger than static_max if maxmem has been
31313136
increased to initial-reservation. *)
3132-
max memory_actual max_memory_bytes
3137+
let result = max memory_actual max_memory_bytes in
3138+
D.debug "VM %s memory limit = %Ld bytes" (Uuidm.to_string uuid) result;
3139+
result
31333140
in
31343141
let rtc =
31353142
try

0 commit comments

Comments
 (0)