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

[Xen-changelog] [xen-unstable] sysctl: Return physinfo.max_{cpu, node}_id as maximum *possible* IDs.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1281707775 -3600
# Node ID f6e1a597a92fd6f84df69ab26622402c275fd960
# Parent  b991ed313c73e0be7e1ebde0804296f502d62b41
sysctl: Return physinfo.max_{cpu,node}_id as maximum *possible* IDs.

In particular, this fixes setting vcpu affinities via
libxl. Previously, the affinity mask would be narrowed to the maximum
currently-online CPU. So future hotplugged CPUs could not be
expressed.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/ia64/xen/dom0_ops.c |    4 ++--
 xen/arch/x86/sysctl.c        |    4 ++--
 xen/include/public/sysctl.h  |    6 ++++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff -r b991ed313c73 -r f6e1a597a92f xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c      Fri Aug 13 14:25:56 2010 +0100
+++ b/xen/arch/ia64/xen/dom0_ops.c      Fri Aug 13 14:56:15 2010 +0100
@@ -736,8 +736,8 @@ long arch_do_sysctl(xen_sysctl_t *op, XE
         pi->scrub_pages      = 0;
         pi->cpu_khz          = local_cpu_data->proc_freq / 1000;
 
-        pi->max_node_id = last_node(node_online_map);
-        pi->max_cpu_id = last_cpu(cpu_online_map);
+        pi->max_node_id = MAX_NUMNODES-1;
+        pi->max_cpu_id = NR_CPUS-1;
 
         if ( copy_field_to_guest(u_sysctl, op, u.physinfo) )
             ret = -EFAULT;
diff -r b991ed313c73 -r f6e1a597a92f xen/arch/x86/sysctl.c
--- a/xen/arch/x86/sysctl.c     Fri Aug 13 14:25:56 2010 +0100
+++ b/xen/arch/x86/sysctl.c     Fri Aug 13 14:56:15 2010 +0100
@@ -62,8 +62,8 @@ long arch_do_sysctl(
             cpus_weight(per_cpu(cpu_core_map, 0)) / pi->threads_per_core;
         pi->nr_cpus = num_online_cpus();
         pi->nr_nodes = num_online_nodes();
-        pi->max_node_id = last_node(node_online_map);
-        pi->max_cpu_id = last_cpu(cpu_online_map);
+        pi->max_node_id = MAX_NUMNODES-1;
+        pi->max_cpu_id = NR_CPUS-1;
         pi->total_pages = total_pages;
         pi->free_pages = avail_domheap_pages();
         pi->scrub_pages = 0;
diff -r b991ed313c73 -r f6e1a597a92f xen/include/public/sysctl.h
--- a/xen/include/public/sysctl.h       Fri Aug 13 14:25:56 2010 +0100
+++ b/xen/include/public/sysctl.h       Fri Aug 13 14:56:15 2010 +0100
@@ -93,8 +93,10 @@ struct xen_sysctl_physinfo {
 struct xen_sysctl_physinfo {
     uint32_t threads_per_core;
     uint32_t cores_per_socket;
-    uint32_t nr_cpus, max_cpu_id;
-    uint32_t nr_nodes, max_node_id;
+    uint32_t nr_cpus;     /* # CPUs currently online */
+    uint32_t max_cpu_id;  /* Largest possible CPU ID on this host */
+    uint32_t nr_nodes;    /* # nodes currently online */
+    uint32_t max_node_id; /* Largest possible node ID on this host */
     uint32_t cpu_khz;
     uint64_aligned_t total_pages;
     uint64_aligned_t free_pages;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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