]> git.proxmox.com Git - qemu-server.git/commit - PVE/QemuServer/Memory.pm
memory: hugepages: map numa node IDs to host and guest correctly
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 29 Jul 2016 11:26:29 +0000 (13:26 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 3 Aug 2016 06:56:30 +0000 (08:56 +0200)
commitaaff69ad5024e95758d69f16afd5ededf518560a
tree864317e3daff196a29e6208188d1ac8c76b55ffa
parentac7b70873ae30bce0dbd226c592ebfef06eb9e01
memory: hugepages: map numa node IDs to host and guest correctly

foreach_dimm() provides a guest numa node index, when used
in conjunction with the guest-to-host numa node topology
mapping one has to make sure that the correct host-side
indices are used.

This covers situations where the user defines a numaX with
hostnodes=Y with Y != X.

For instance:
  cores: 2
  hotplug: disk,network,cpu,memory
  hugepages: 2
  memory: 2048
  numa: 1
  numa1: memory=512,hostnodes=0,cpus=0-1,policy=bind
  numa2: memory=512,hostnodes=0,cpus=2-3,policy=bind

Both numa IDs 1 and 2 passed by foreach_dimm() have to be
mapped to host node 0.

Note that this also reverses the foreach_reverse_dimm() numa
node numbering as the current code, while walking sizes
backwards, walked the numa IDs inside each size forward,
which makes more sense. (Memory hot-unplug is still working
with this.)
PVE/QemuServer/Memory.pm