]> git.proxmox.com Git - mirror_qemu.git/commit - numa.c
numa: add '-numa cpu,...' option for property based node mapping
authorIgor Mammedov <imammedo@redhat.com>
Wed, 10 May 2017 11:30:01 +0000 (13:30 +0200)
committerEduardo Habkost <ehabkost@redhat.com>
Thu, 11 May 2017 19:08:50 +0000 (16:08 -0300)
commit419fcdec3c1ff545cd33d90ade99236c9bcc37cc
tree60fbc17cc6fd58adb35fd22c5bf87dde913e4103
parent1171ae9a5b132dc631728ff17688d05ed4534181
numa: add '-numa cpu,...' option for property based node mapping

legacy cpu to node mapping is using cpu index values to map
VCPU to node with help of '-numa node,nodeid=node,cpus=x[-y]'
option. However cpu index is internal concept and QEMU users
have to guess /reimplement qemu's logic/ to map it to
a concrete cpu socket/core/thread to make sane CPUs
placement across numa nodes.

This patch allows to map cpu objects to numa nodes using
the same properties as used for cpus with -device/device_add
(socket-id/core-id/thread-id/node-id).

At present valid properties/values to address CPUs could be
fetched using hotpluggable-cpus monitor/qmp command, it will
require user to start qemu twice when creating domain to fetch
possible CPUs for a machine type/-smp layout first and
then the second time with numa explicit mapping for actual
usage. The first step results could be saved and reused to
set/change mapping later as far as machine type/-smp stays
the same.

Proposed impl. supports exact and wildcard matching to
simplify CLI and allow to set mapping for a specific cpu
or group of cpu objects specified by matched properties.

For example:

   # exact mapping x86
   -numa cpu,node-id=x,socket-id=y,core-id=z,thread-id=n

   # exact mapping SPAPR
   -numa cpu,node-id=x,core-id=y

   # wildcard mapping, all cpu objects that match socket-id=y
   # are mapped to node-id=x
   -numa cpu,node-id=x,socket-id=y

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1494415802-227633-18-git-send-email-imammedo@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
numa.c
qapi-schema.json
qemu-options.hx