Skip to contentSkip to conversation

xl cpupool-numa-split: don't try to bring any dom0 vCPUs online

PATCH In review Jonathan Davies 2 participants 2 messages Aug 12, 2016 – Aug 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xl cpupool-numa-split: don't try to bring any dom0 vCPUs online

Since commit a9dd01431a799b6743193a75f4f1ce2fdfdb7296, main_cpupoolnumasplit wants to ensure that dom0 doesn't have more online vCPUs than the number of pCPUs in a NUMA node.

However, if dom0 already has fewer online vCPUs than the number of pCPUs in a NUMA node, this will cause some to be made online.

Furthermore, if dom0's maximum number of vCPUs is less than the number of pCPUs, this will result in an error like the following:

libxl: error: libxl.c:5564:libxl_set_vcpuonline: Requested 24 VCPUs, however maxcpus is 12!: Function not implemented error on removing vcpus for Domain-0

Instead, make main_cpupoolnumasplit only reduce the number of vCPUs dom0 has online, and don't try to add any more.

This incurs an extra call to libxl_domain_info to find out the current number of dom0 vCPUs. Conveniently, there is already an initialised libxl_dominfo that we can use.

---
 tools/libxl/xl_cmdimpl.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
tools/libxl/xl_cmdimpl.c +9 -2
index 7f961e3..d5df20d 100644
@@ -8614,12 +8614,19 @@ int main_cpupoolnumasplit(int argc, char **argv)
         goto out;
     }
 
+    if (libxl_domain_info(ctx, &info, 0)) {
+        fprintf(stderr, "error on getting info for Domain-0\n");
+        goto out;
+    }
+
     n = 0;
     for (c = 0; c < n_cpus; c++) {
         if (topology[c].node == node) {
             topology[c].node = LIBXL_CPUTOPOLOGY_INVALID_ENTRY;
-            libxl_bitmap_set(&cpumap, n);
-            n++;
+            if (n < info.vcpu_online) {
+                libxl_bitmap_set(&cpumap, n);
+                n++;
+            }
         }
     }
     if (libxl_domain_info(ctx, &info, 0)) {
Signature · 7 lines
1.9.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 13 lines · Jonathan Davies

Since commit a9dd01431a799b6743193a75f4f1ce2fdfdb7296, main_cpupoolnumasplit wants to ensure that dom0 doesn't have more online vCPUs than the number of pCPUs in a NUMA node.

However, if dom0 already has fewer online vCPUs than the number of pCPUs in a NUMA node, this will cause some to be made online.

Furthermore, if dom0's maximum number of vCPUs is less than the number of pCPUs, this will result in an error like the following:

libxl: error: libxl.c:5564:libxl_set_vcpuonline: Requested 24 VCPUs, however maxcpus is 12!: Function not implemented error on removing vcpus for Domain-0

Quoted 6 lines

Instead, make main_cpupoolnumasplit only reduce the number of vCPUs dom0 has online, and don't try to add any more.

This incurs an extra call to libxl_domain_info to find out the current number of dom0 vCPUs. Conveniently, there is already an initialised libxl_dominfo that we can use.

Commit c256d2afc1cad0cca912492e338d6ff97e477c4f already corrects this problem.

Ian, there seems to be some need to backport above commit.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel