[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2/2] xen: fill topology info for online cpus only



The topology information obtainable via XEN_SYSCTL_cputopoinfo is
filled rather weird: the size of the array is derived from the highest
online cpu number, while the data is set to "invalid" for not present
cpus only.

With smt=0 the information for parked threads is all zero, so it should
be best to return "invalid" information for offline cpus.

On a dual core system without this patch xl info -n will print:

cpu_topology           :
cpu:    core    socket     node
  0:       0        0        0
  1:       0        0        0
  2:       1        0        0

while with this patch the output is:

cpu_topology           :
cpu:    core    socket     node
  0:       0        0        0
  2:       1        0        0

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
 xen/common/sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 8e83c33a16..6cef6d310b 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -358,7 +358,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) 
u_sysctl)
                 num_cpus = ti->num_cpus;
             for ( i = 0; i < num_cpus; ++i )
             {
-                if ( cpu_present(i) )
+                if ( cpu_online(i) )
                 {
                     cputopo.core = cpu_to_core(i);
                     cputopo.socket = cpu_to_socket(i);
-- 
2.16.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.