aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2022-10-14 15:47:19 +0200
committerDavid Hildenbrand <david@redhat.com>2022-10-27 11:01:03 +0200
commite6816458624813de4a31f89096a620b410e1c2b8 (patch)
tree327eb49230110c949e5443ebae4d1fd64336acf8 /include
parente04a34e55cf1911099e2d8a680f9bee4f6d90e4a (diff)
downloadqemu-e6816458624813de4a31f89096a620b410e1c2b8.zip
qemu-e6816458624813de4a31f89096a620b410e1c2b8.tar.gz
qemu-e6816458624813de4a31f89096a620b410e1c2b8.tar.bz2
hostmem: Allow for specifying a ThreadContext for preallocation
Let's allow for specifying a thread context via the "prealloc-context" property. When set, preallcoation threads will be crated via the thread context -- inheriting the same CPU affinity as the thread context. Pinning preallcoation threads to CPUs can heavily increase performance in NUMA setups, because, preallocation from a CPU close to the target NUMA node(s) is faster then preallocation from a CPU further remote, simply because of memory bandwidth for initializing memory with zeroes. This is especially relevant for very large VMs backed by huge/gigantic pages, whereby preallocation is mandatory. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Message-Id: <20221014134720.168738-7-david@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/sysemu/hostmem.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h
index 9ff5c16..39326f1 100644
--- a/include/sysemu/hostmem.h
+++ b/include/sysemu/hostmem.h
@@ -18,6 +18,7 @@
#include "qom/object.h"
#include "exec/memory.h"
#include "qemu/bitmap.h"
+#include "qemu/thread-context.h"
#define TYPE_MEMORY_BACKEND "memory-backend"
OBJECT_DECLARE_TYPE(HostMemoryBackend, HostMemoryBackendClass,
@@ -66,6 +67,7 @@ struct HostMemoryBackend {
bool merge, dump, use_canonical_path;
bool prealloc, is_mapped, share, reserve;
uint32_t prealloc_threads;
+ ThreadContext *prealloc_context;
DECLARE_BITMAP(host_nodes, MAX_NODES + 1);
HostMemPolicy policy;