WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] sysctl: Return physinfo.max_{cpu, node}_i

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] sysctl: Return physinfo.max_{cpu, node}_id as maximum *possible* IDs.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Aug 2010 07:00:39 -0700
Delivery-date: Wed, 18 Aug 2010 07:03:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] sysctl: Return physinfo.max_{cpu, node}_id as maximum *possible* IDs., Xen patchbot-unstable <=