]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Use the CPU index in capabilities to map NUMA node to cpu list.
authorOsier Yang <jyang@redhat.com>
Sat, 12 May 2012 12:52:45 +0000 (20:52 +0800)
committerCole Robinson <crobinso@redhat.com>
Thu, 14 Jun 2012 22:16:49 +0000 (18:16 -0400)
commite88212d583c7ee9f59b4dab573f6d744ef93d8a4
treee8941b85158b2bc0ae956338be48995c3a673cc6
parentd8a1c6b70cd34040171730848e0d33880d9a4ac4
qemu: Use the CPU index in capabilities to map NUMA node to cpu list.

On some of the NUMA platforms, the CPU index in each NUMA node
grows non-consecutive. While on other platforms, it can be inconsecutive,
E.g.

% numactl --hardware
available: 4 nodes (0-3)
node 0 cpus: 0 4 8 12 16 20 24 28
node 0 size: 131058 MB
node 0 free: 86531 MB
node 1 cpus: 1 5 9 13 17 21 25 29
node 1 size: 131072 MB
node 1 free: 127070 MB
node 2 cpus: 2 6 10 14 18 22 26 30
node 2 size: 131072 MB
node 2 free: 127758 MB
node 3 cpus: 3 7 11 15 19 23 27 31
node 3 size: 131072 MB
node 3 free: 127226 MB
node distances:
node   0   1   2   3
  0:  10  20  20  20
  1:  20  10  20  20
  2:  20  20  10  20
  3:  20  20  20  10

This patch is to fix the problem by using the CPU index in
caps->host.numaCell[i]->cpus[i] to set the bitmask instead of
assuming the CPU index of the NUMA nodes are always sequential.
(cherry picked from commit d1bdeca875d92c6fe9c9eb854fa1f3d891fef84a)
src/qemu/qemu_process.c