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] xend: NUMA: fix division by zero on unpopulated node

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] xend: NUMA: fix division by zero on unpopulated nodes
From: Andre Przywara <andre.przywara@xxxxxxx>
Date: Thu, 14 Jan 2010 17:32:17 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 14 Jan 2010 08:32:11 -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.18 (X11/20081105)
Hi,

nodes without memory will currently be disabled by also moving the physical cores connected to them to other nodes. This leads to nodes without CPUs and thus to a division by zero in the node allocation algorithm. Attached patch fixes this by checking for 0 before the division. This fixes domain creation on boxes with memory-less nodes. The resulting domain distribution is still not correct, I will send another patch after more testing.

Regards,
Andre.

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

--
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 488-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 e406e3451835 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Thu Jan 14 10:14:17 2010 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Thu Jan 14 15:16:28 2010 +0100
@@ -2709,9 +2709,12 @@
                                     nodeload[i] += 1
                                     break
                 for i in range(0, nr_nodes):
-                    nodeload[i] = int(nodeload[i] * 16 / 
len(info['node_to_cpu'][i]))
-                    if len(info['node_to_cpu'][i]) == 0 or i not in node_list:
-                        nodeload[i] += 8
+                    if len(info['node_to_cpu'][i]) == 0:
+                       nodeload[i] += 8
+                    else:
+                        nodeload[i] = int(nodeload[i] * 16 / 
len(info['node_to_cpu'][i]))
+                        if i not in node_list:
+                            nodeload[i] += 8
                 return map(lambda x: x[0], sorted(enumerate(nodeload), 
key=lambda x:x[1]))
 
             info = xc.physinfo()
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xend: NUMA: fix division by zero on unpopulated nodes, Andre Przywara <=