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-devel

[Xen-devel] [PATCH] numa: fix problems with memory-less nodes

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] numa: fix problems with memory-less nodes
From: Andre Przywara <andre.przywara@xxxxxxx>
Date: Tue, 12 Jan 2010 17:30:09 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 12 Jan 2010 08:31:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.21 (X11/20090329)
Hi,

If we decided to not report memory-less nodes in physinfo we should also skip them in the node_to_{cpu,memory,dma32_mem} Python lists. Currently Xen will not start guests on machines with memory-less nodes which are not the last ones. On an 8-node machine with empty nodes 4 and 5 "xm info" was reporting wrongly, also the node assignment algorithm crashed with a division by zero error. The attached patch fixes this by skipping empty nodes in the enumeration of resources.

Regards,
Andre.


Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx>

--
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 448 3567 12
----to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd; Thomas M. McCoy; Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
diff -r 0e3910f1de64 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Tue Jan 12 07:17:40 2010 +0000
+++ b/tools/python/xen/lowlevel/xc/xc.c Tue Jan 12 17:28:55 2010 +0100
@@ -1129,20 +1129,23 @@
             Py_DECREF(pyint);
             node_exists = 1;
         }
-        PyList_Append(node_to_cpu_obj, cpus); 
+        if (node_exists)
+            PyList_Append(node_to_cpu_obj, cpus); 
         Py_DECREF(cpus);
 
         /* Memory. */
         xc_availheap(self->xc_handle, 0, 0, i, &free_heap);
         node_exists = node_exists || (free_heap != 0);
         pyint = PyInt_FromLong(free_heap / 1024);
-        PyList_Append(node_to_memory_obj, pyint);
+        if (node_exists)
+            PyList_Append(node_to_memory_obj, pyint);
         Py_DECREF(pyint);
 
         /* DMA memory. */
         xc_availheap(self->xc_handle, 0, 32, i, &free_heap);
         pyint = PyInt_FromLong(free_heap / 1024);
-        PyList_Append(node_to_dma32_mem_obj, pyint);
+        if (node_exists)
+            PyList_Append(node_to_dma32_mem_obj, pyint);
         Py_DECREF(pyint);
 
         if ( node_exists )
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel