]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuBuildThreadContextProps: Generate ThreadContext less frequently
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 5 Jan 2023 08:51:07 +0000 (09:51 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 13 Jan 2023 07:43:30 +0000 (08:43 +0100)
commit8ff8fe3f8a7bb67a150c7f4801c2df5ef743aa8f
tree07e99882026117dd4ca1cae0ba9e5e4ce127540c
parented6b8a30b90807d5a4d6bc0a5d0ec99fd5f040ff
qemuBuildThreadContextProps: Generate ThreadContext less frequently

Currently, the ThreadContext object is generated whenever we see
.host-nodes attribute for a memory-backend-* object. The idea was
that when the backend is pinned to a specific set of host NUMA
nodes, then the allocation could be happening on CPUs from those
nodes too. But this may not be always possible.

Users might configure their guests in such way that vCPUs and
corresponding guest NUMA nodes are on different host NUMA nodes
than emulator thread. In this case, ThreadContext won't work,
because ThreadContext objects live in context of the emulator
thread (vCPU threads are moved around by us later, when emulator
thread finished its setup and spawned vCPU threads - see
qemuProcessSetupVcpus()). Therefore, memory allocation is done by
emulator thread which is pinned to a subset of host NUMA nodes,
but tries to create a ThreadContext object with a disjoint subset
of host NUMA nodes, which fails.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2154750
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/hugepages-memaccess2.x86_64-latest.args
tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
tests/qemuxml2argvdata/numatune-memnode.x86_64-latest.args
tests/qemuxml2argvdata/numatune-system-memory.x86_64-latest.args