debuggers.hg

changeset 20858:36c40adffe12

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@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Sun Jan 17 18:01:08 2010 +0000 (2010-01-17)
parents 8bbb0dd9a340
children efbd58260961
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Sun Jan 17 17:57:44 2010 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Sun Jan 17 18:01:08 2010 +0000
     1.3 @@ -2709,9 +2709,12 @@ class XendDomainInfo:
     1.4                                      nodeload[i] += 1
     1.5                                      break
     1.6                  for i in range(0, nr_nodes):
     1.7 -                    nodeload[i] = int(nodeload[i] * 16 / len(info['node_to_cpu'][i]))
     1.8 -                    if len(info['node_to_cpu'][i]) == 0 or i not in node_list:
     1.9 +                    if len(info['node_to_cpu'][i]) == 0:
    1.10                          nodeload[i] += 8
    1.11 +                    else:
    1.12 +                        nodeload[i] = int(nodeload[i] * 16 / len(info['node_to_cpu'][i]))
    1.13 +                        if i not in node_list:
    1.14 +                            nodeload[i] += 8
    1.15                  return map(lambda x: x[0], sorted(enumerate(nodeload), key=lambda x:x[1]))
    1.16  
    1.17              info = xc.physinfo()