]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Explicitly forbid live changing nodeset for strict numatune
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Dec 2021 13:20:21 +0000 (14:20 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 17 Dec 2021 12:21:48 +0000 (13:21 +0100)
commit06f405c627c9c6fa3dd207f782beaadc0b6cba95
treebc1013bf3789b7c330036fac83329d014b4ebbaf
parenta19b93d4e08c7495dcd7c2afaf1ad511ea8d5dba
qemu: Explicitly forbid live changing nodeset for strict numatune

Let's imagine a guest that's configured with strict numatune:

  <numatune>
    <memory mode='strict' nodeset='0'/>
  </numatune>

For guests with NUMA:
Depending on machine type used (see commit v6.4.0-rc1~75) we
generate either:

  1) -object '{"qom-type":"memory-backend-ram","id":"ram-node0",\
               "size":20971520,"host-nodes":[0],"policy":"preferred"}' \
     -numa node,nodeid=0,cpus=0,memdev=ram-node0

or

  2) -numa node,nodeid=0,cpus=0,mem=20480

Later, when QEMU boots up and cpuset CGroup controller is
available we further restrict QEMU there too. But there's a
behaviour difference hidden: while in case 1) QEMU is restricted
from beginning, in case 2) it is not and thus it may happen that
it will allocate memory from different NUMA node and even though
CGroup will try to migrate it, it may fail to do so (e.g. because
memory is locked). Therefore, one can argue that case 2) is
broken. NB, case 2) is exactly what mode 'restrictive' is for.
However, in case 1) we are unable to update QEMU with new
host-nodes, simply because it's lacking a command to do so.

For guests without NUMA:
It's very close to case 2) from above. We have commit
v7.10.0-rc1~163 that prevents us from outputting host-nodes when
generating memory-backend-* for system memory, but that simply
allows QEMU to allocate memory anywhere and then relies on
CGroups to move it to desired location.

Due to all of this, there is no reliable way to change nodeset
for mode 'strict'. Let's forbid it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
docs/manpages/virsh.rst
src/libvirt-domain.c
src/qemu/qemu_driver.c