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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: NUMA: fix division by zero on unpopulated nodes
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 18 Jan 2010 02:50:20 -0800
Delivery-date: Mon, 18 Jan 2010 02:50:30 -0800
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 1263751268 0
# Node ID 36c40adffe126f77bb661895c8a507112988c881
# Parent  8bbb0dd9a340a3ae7011b35945d496d4d1910818
xend: NUMA: fix division by zero on unpopulated nodes

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.

Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -r 8bbb0dd9a340 -r 36c40adffe12 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Sun Jan 17 17:57:44 2010 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Sun Jan 17 18:01:08 2010 +0000
@@ -2709,9 +2709,12 @@ class XendDomainInfo:
                                     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:
+                    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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: NUMA: fix division by zero on unpopulated nodes, Xen patchbot-unstable <=