xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xl cpupool-numa-split: don't try to bring any dom0 vCPUs online
@ 2016-08-12 13:11 Jonathan Davies
  2016-08-15  4:19 ` Juergen Gross
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Davies @ 2016-08-12 13:11 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, Jonathan Davies, Ian Jackson, Wei Liu

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.

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
---
 tools/libxl/xl_cmdimpl.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 7f961e3..d5df20d 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -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)) {
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xl cpupool-numa-split: don't try to bring any dom0 vCPUs online
  2016-08-12 13:11 [PATCH] xl cpupool-numa-split: don't try to bring any dom0 vCPUs online Jonathan Davies
@ 2016-08-15  4:19 ` Juergen Gross
  0 siblings, 0 replies; 2+ messages in thread
From: Juergen Gross @ 2016-08-15  4:19 UTC (permalink / raw)
  To: Jonathan Davies, xen-devel; +Cc: Wei Liu, Ian Jackson

On 12/08/16 15:11, Jonathan Davies wrote:
> 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.

Commit c256d2afc1cad0cca912492e338d6ff97e477c4f already corrects this
problem.

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


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-15  4:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-12 13:11 [PATCH] xl cpupool-numa-split: don't try to bring any dom0 vCPUs online Jonathan Davies
2016-08-15  4:19 ` Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).