
On 11/5/18 3:49 PM, Michal Privoznik wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1624223
There are two ways to request memory preallocation on cmd line: -mem-prealloc and .prealloc attribute to memory-backend-file. However, as it turns out it's not safe to use both at the same time. Prefer -mem-prealloc as it is more backward compatible compared to switching to "-numa node,memdev= + -object memory-backend-file".
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/qemu/qemu_command.c | 37 +++++++++++++------ src/qemu/qemu_command.h | 1 + src/qemu/qemu_domain.c | 2 + src/qemu/qemu_domain.h | 3 ++ src/qemu/qemu_hotplug.c | 3 +- .../hugepages-numa-default-dimm.args | 2 +- 6 files changed, 35 insertions(+), 13 deletions(-)
Ping? After some discussion with QEMU devels, I found out that this might be harmful/suboptimal. Thing is, if -mem-prealloc is used then qemu will fully allocate the memory (this is done by actually touching every page that has been allocated). Then, if .prealloc=yes is specified, mbind(flags = MPOL_MF_STRICT | MPOL_MF_MOVE) is called which: a) has to (possibly) move the memory to a different NUMA node, b) can have no effect when hugepages are in play (thus ignoring user request to place memory on desired NUMA nodes). While I could live with a), I couldn't with b). The patch is still valid. Michal