Skip to content

Conversation

@mg12
Copy link
Member

@mg12 mg12 commented Jan 19, 2026

This PR contains the same patches for XS9 that were present in the patchqueue.

I organised the PR so that each merge corresponds to an entry in the patchqueue:

  • 0004-rrd3.patch
  • 0003-CP-53658-adapt-claim_pages-to-version-in-xen-4.21-wi.patch
  • 0005-xenopsd-xc-do-not-try-keep-track-of-free-memory-when.patch
  • 0005-rrd4.patch

The behaviour is unchanged compared to the patchqueue (the code is the same).

Tested with BVT 233166.
Verified that the RRD metrics in the patches are preserved as expected, using:

# xe vm-list params=all| grep numa
                        numa-optimised ( RO): true
                            numa-nodes ( RO): 1
                      numa-node-memory (MRO): 0: 2149572608; 1: 0

# rrd2csv AVERAGE:::numa_nodes
timestamp, AVERAGE:vm:5d9459d1-7209-ee36-e404-c6b537aa2cd3:numa_nodes
2026-01-19T13:30:15Z, 1
2026-01-19T13:30:20Z, 1
^C
[# rrd2csv AVERAGE:::memory_numa_node
timestamp, AVERAGE:vm:5d9459d1-7209-ee36-e404-c6b537aa2cd3:memory_numa_node_1, AVERAGE:vm:5d9459d1-7209-ee36-e404-c6b537aa2cd3:memory_numa_node_0
2026-01-19T13:30:25Z, 0, 2149572608
2026-01-19T13:30:30Z, 0, 2149572608
2026-01-19T13:30:35Z, 0, 2149572608
^C

mg12 and others added 10 commits January 19, 2026 17:34
Adding a new CPU RRD metric: "numa_node_nonaffine_vcpus" per domain
as fraction of vCPU time running outside of vCPU affinity.

Signed-off-by: Marcus Granado <[email protected]>
Merge branch 'cp-310822-upstream-patchqueue-1-rrd3' into cp-310822-upstream-patchqueue

Signed-off-by: Marcus Granado <[email protected]>
Now the numa node needs to be passed. A special value of (~0U) is used to
signify that no node is meant to be used. Since this is arch-dependent,
and contained in a long in x86_64, an int is used to encode the value.

Also remove the exception that was guarding the codepath to use this case

Signed-off-by: Pau Ruiz Safont <[email protected]>
Signed-off-by: Christian Lindig <[email protected]>
…rsion-in-xen-4.21-wi

Merge branch 'cp-310822-upstream-patchqueue-2-cp-53658' into cp-310822-upstream-patchqueue

Signed-off-by: Marcus Granado <[email protected]>
…odes (CA-411684)

Free memory is now properly accounted for because the memory pages are claimed
within the NUMA mutex, so there's no need to have double tracking.

On top of that, this code never increased the free memory, which means that it
always reached a point where it was impossible to allocate a domain into a
single numa node.

Signed-off-by: Pau Ruiz Safont <[email protected]>
…k-of-free-memory-when

Merge branch 'cp-310822-upstream-patchqueue-3-ca-411684' into cp-310822-upstream-patchqueue

Signed-off-by: Marcus Granado <[email protected]>
Merge branch 'cp-310822-upstream-patchqueue-4-cp-54238' into cp-310822-upstream-patchqueue

Signed-off-by: Marcus Granado <[email protected]>
@mg12 mg12 requested review from edwintorok, lindig and robhoes January 19, 2026 19:41
@robhoes
Copy link
Member

robhoes commented Jan 20, 2026

/usr/bin/ld: ocaml/libs/xenctrl-ext/libxenctrl_ext_stubs.a(xenctrlext_stubs.o): in function `stub_xenctrlext_domain_claim_pages':
/home/runner/work/xen-api/xen-api/_build/default/ocaml/libs/xenctrl-ext/xenctrlext_stubs.c:688: undefined reference to `xc_domain_claim_pages_node'
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking (exit code 1)

@mg12 looks like this needs:

  • a reformat
  • the function above added to the mock bindings in xapi-project/xenctrl

mg12 added 3 commits January 20, 2026 19:03
this avoids a link error in systems that don't have this function:

/usr/bin/ld:
ocaml/libs/xenctrl-ext/libxenctrl_ext_stubs.a(xenctrlext_stubs.o): in
function `stub_xenctrlext_domain_claim_pages':
xen-api/_build/default/ocaml/libs/xenctrl-ext/xenctrlext_stubs.c:688:
undefined reference to `xc_domain_claim_pages_node'

set errno to ENOSYS if not defined, to keep behaviour
consistent with other stubs in this file.

keep CAMLparam4 in both cases to avoid unused parameter warnings.

Signed-off-by: Marcus Granado <[email protected]>
Signed-off-by: Marcus Granado <[email protected]>
@mg12 mg12 force-pushed the private/marcusg/cp-310822-upstream-patchqueue branch from a287d59 to 4eb2ca1 Compare January 20, 2026 23:40
@mg12
Copy link
Member Author

mg12 commented Jan 21, 2026

4eb2ca1 passed BVT 233201, and has the RRD metrics as expected:

[root@genus-35-110d ~]# xe vm-list params=all | grep numa
                        numa-optimised ( RO): true
                            numa-nodes ( RO): 1
                      numa-node-memory (MRO): 0: 2149568512
[root@genus-35-110d ~]# rrd2csv AVERAGE:::numa_nodes
timestamp, AVERAGE:vm:38664a5b-b0c0-ae5e-c01e-54ddd1b1bbe6:numa_nodes
2026-01-20T23:35:25Z, 1
2026-01-20T23:35:30Z, 1
^C
[root@genus-35-110d ~]# rrd2csv AVERAGE:::memory_numa_node
timestamp, AVERAGE:vm:38664a5b-b0c0-ae5e-c01e-54ddd1b1bbe6:memory_numa_node_0
2026-01-20T23:35:40Z, 2149568512
2026-01-20T23:35:45Z, 2149568512
^C

@robhoes robhoes added this pull request to the merge queue Jan 21, 2026
Merged via the queue into master with commit f05fa58 Jan 21, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants