diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-01-14 09:44:08 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-01-14 09:44:08 +0000 |
commit | 735f8ebd5391b78088335043818e3b4ffa0124a5 (patch) | |
tree | e00f684d037f91d1f9d108cd34c53b0fadb91b4c | |
parent | 0b5e4f99aed9c43ba1feb0a4e97d97bc96d1d172 (diff) | |
download | xen-735f8ebd5391b78088335043818e3b4ffa0124a5.tar.gz xen-735f8ebd5391b78088335043818e3b4ffa0124a5.tar.bz2 xen-735f8ebd5391b78088335043818e3b4ffa0124a5.zip |
xend, NUMA: Fix computation of needed nodes
Enumerate the best nodes and add CPU affinity until all VCPUs can be
backed by at least one physical core. This should fix problems with
asymmetric NUMA configurations and cropped number of CPUs in Xen.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
-rw-r--r-- | tools/python/xen/xend/XendDomainInfo.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 1a5ead0d33..6c23fc9be7 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -2724,13 +2724,12 @@ class XendDomainInfo: candidate_node_list.append(i) best_node = find_relaxed_node(candidate_node_list)[0] cpumask = info['node_to_cpu'][best_node] - cores_per_node = info['nr_cpus'] / info['nr_nodes'] - nodes_required = (self.info['VCPUs_max'] + cores_per_node - 1) / cores_per_node - if nodes_required > 1: - log.debug("allocating %d NUMA nodes", nodes_required) - best_nodes = find_relaxed_node(filter(lambda x: x != best_node, range(0,info['nr_nodes']))) - for i in best_nodes[:nodes_required - 1]: - cpumask = cpumask + info['node_to_cpu'][i] + best_nodes = find_relaxed_node(filter(lambda x: x != best_node, range(0,info['nr_nodes']))) + for node_idx in best_nodes: + if len(cpumask) >= self.info['VCPUs_max']: + break + cpumask = cpumask + info['node_to_cpu'][node_idx] + log.debug("allocating additional NUMA node %d", node_idx) for v in range(0, self.info['VCPUs_max']): xc.vcpu_setaffinity(self.domid, v, cpumask) return index |