]> 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)
committerOsier Yang <jyang@redhat.com>
Tue, 15 May 2012 02:09:43 +0000 (10:09 +0800)
commitd1bdeca875d92c6fe9c9eb854fa1f3d891fef84a
tree737d7b2143cf7e6e2fb15859b709753780c83ef9
parentbb725ac1faf1e0cee1efd3d5b94c4fba87988e3a
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.
src/qemu/qemu_process.c