Commit 6a2e5ac
authored
CA-423204: use xen field meminfo.claimed to calculate available memory in node for new VM (#6867)
The available memory in the node that can actually be further claimed in
the node for a new VM needs to be calculated as
(meminfo.memfree - meminfo.claimed). Considering only meminfo.memfree
does not consider VMs that may have claimed in the node but not yet
finished allocating the claimed amount.
A new debug line during the calculation makes it easier to understand
the different node memory values being considered and calculated for the
VMs being created, eg:
```
2026-01-27T00:03:44.788754+00:00 orca xenopsd-xc: [debug||22 |Async.VM.start_on R:4533f11cb6bf|xenops]
mem_claimable_for_new_vm: NUMA nodeid=0, domid=69: memfree=281696272384 memsize=825707462656 claimed=249459507200: available=32236765184
2026-01-27T00:03:44.788770+00:00 orca xenopsd-xc: [debug||22 |Async.VM.start_on R:4533f11cb6bf|xenops]
mem_claimable_for_new_vm: NUMA nodeid=1, domid=69: memfree=336155111424 memsize=824633720832 claimed=303146598400: available=33008513024
...
```
Tested with:
* SR-233407 (xs9 numa functional regression test)
* job 4541679, where this change calculates the correct nodes to start
the VMs in a host with 8 nodes and high contention of VMs starting
simultaneously.File tree
5 files changed
+143
-15
lines changed- ocaml
- libs/xenctrl-ext
- xenopsd/xc
5 files changed
+143
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
129 | 138 | | |
130 | | - | |
131 | | - | |
| 139 | + | |
| 140 | + | |
132 | 141 | | |
133 | 142 | | |
134 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
718 | 816 | | |
719 | 817 | | |
720 | 818 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
995 | 995 | | |
996 | 996 | | |
997 | 997 | | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
998 | 1008 | | |
999 | 1009 | | |
1000 | 1010 | | |
1001 | | - | |
| 1011 | + | |
1002 | 1012 | | |
1003 | 1013 | | |
1004 | 1014 | | |
1005 | 1015 | | |
1006 | | - | |
1007 | | - | |
| 1016 | + | |
| 1017 | + | |
1008 | 1018 | | |
1009 | 1019 | | |
1010 | 1020 | | |
| |||
1021 | 1031 | | |
1022 | 1032 | | |
1023 | 1033 | | |
1024 | | - | |
| 1034 | + | |
1025 | 1035 | | |
1026 | 1036 | | |
1027 | | - | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
1028 | 1041 | | |
1029 | 1042 | | |
1030 | 1043 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 52 | + | |
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
58 | | - | |
59 | | - | |
60 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
61 | 60 | | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
0 commit comments