aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorMark Kanda <mark.kanda@oracle.com>2024-01-31 10:53:27 -0600
committerDavid Hildenbrand <david@redhat.com>2024-02-06 08:15:22 +0100
commit04accf43df83aa10f06f7dbda3ecf0db97f0c5a6 (patch)
treec5668fe7f5ae98622af2f69ac4f2a97ff219a97a /system
parent540a1abbf0b243e4cfb4333c5d30a041f7080ba4 (diff)
downloadqemu-04accf43df83aa10f06f7dbda3ecf0db97f0c5a6.zip
qemu-04accf43df83aa10f06f7dbda3ecf0db97f0c5a6.tar.gz
qemu-04accf43df83aa10f06f7dbda3ecf0db97f0c5a6.tar.bz2
oslib-posix: initialize backend memory objects in parallel
QEMU initializes preallocated backend memory as the objects are parsed from the command line. This is not optimal in some cases (e.g. memory spanning multiple NUMA nodes) because the memory objects are initialized in series. Allow the initialization to occur in parallel (asynchronously). In order to ensure optimal thread placement, asynchronous initialization requires prealloc context threads to be in use. Signed-off-by: Mark Kanda <mark.kanda@oracle.com> Message-ID: <20240131165327.3154970-2-mark.kanda@oracle.com> Tested-by: Mario Casquero <mcasquer@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'system')
-rw-r--r--system/vl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/system/vl.c b/system/vl.c
index bb959cb..2a0bd08 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -2013,6 +2013,14 @@ static void qemu_create_late_backends(void)
object_option_foreach_add(object_create_late);
+ /*
+ * Wait for any outstanding memory prealloc from created memory
+ * backends to complete.
+ */
+ if (!qemu_finish_async_prealloc_mem(&error_fatal)) {
+ exit(1);
+ }
+
if (tpm_init() < 0) {
exit(1);
}
@@ -3699,6 +3707,7 @@ void qemu_init(int argc, char **argv)
* over memory-backend-file objects).
*/
qemu_create_late_backends();
+ phase_advance(PHASE_LATE_BACKENDS_CREATED);
/*
* Note: creates a QOM object, must run only after global and