diff options
| author | Mark Kanda <mark.kanda@oracle.com> | 2024-01-31 10:53:27 -0600 |
|---|---|---|
| committer | David Hildenbrand <david@redhat.com> | 2024-02-06 08:15:22 +0100 |
| commit | 04accf43df83aa10f06f7dbda3ecf0db97f0c5a6 (patch) | |
| tree | c5668fe7f5ae98622af2f69ac4f2a97ff219a97a /hw/virtio/virtio-mem.c | |
| parent | 540a1abbf0b243e4cfb4333c5d30a041f7080ba4 (diff) | |
| download | focaccia-qemu-04accf43df83aa10f06f7dbda3ecf0db97f0c5a6.tar.gz focaccia-qemu-04accf43df83aa10f06f7dbda3ecf0db97f0c5a6.zip | |
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 'hw/virtio/virtio-mem.c')
| -rw-r--r-- | hw/virtio/virtio-mem.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index 99ab989852..ffd119ebac 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -605,7 +605,7 @@ static int virtio_mem_set_block_state(VirtIOMEM *vmem, uint64_t start_gpa, int fd = memory_region_get_fd(&vmem->memdev->mr); Error *local_err = NULL; - if (!qemu_prealloc_mem(fd, area, size, 1, NULL, &local_err)) { + if (!qemu_prealloc_mem(fd, area, size, 1, NULL, false, &local_err)) { static bool warned; /* @@ -1248,7 +1248,7 @@ static int virtio_mem_prealloc_range_cb(VirtIOMEM *vmem, void *arg, int fd = memory_region_get_fd(&vmem->memdev->mr); Error *local_err = NULL; - if (!qemu_prealloc_mem(fd, area, size, 1, NULL, &local_err)) { + if (!qemu_prealloc_mem(fd, area, size, 1, NULL, false, &local_err)) { error_report_err(local_err); return -ENOMEM; } |