[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 6/8] virtio-mem: Fail if a memory backend with "prealloc=o
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH v3 6/8] virtio-mem: Fail if a memory backend with "prealloc=on" is specified |
Date: |
Thu, 12 Jan 2023 18:33:10 +0000 |
User-agent: |
Mutt/2.2.9 (2022-11-12) |
* David Hildenbrand (david@redhat.com) wrote:
> "prealloc=on" for the memory backend does not work as expected, as
> virtio-mem will simply discard all preallocated memory immediately again.
> In the best case, it's an expensive NOP. In the worst case, it's an
> unexpected allocation error.
>
> Instead, "prealloc=on" should be specified for the virtio-mem device only,
> such that virtio-mem will try preallocating memory before plugging
> memory dynamically to the guest. Fail if such a memory backend is
> provided.
>
> Tested-by: Michal Privoznik <mprivozn@redhat.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> hw/virtio/virtio-mem.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
> index 1ed1f5a4af..02f7b5469a 100644
> --- a/hw/virtio/virtio-mem.c
> +++ b/hw/virtio/virtio-mem.c
> @@ -772,6 +772,12 @@ static void virtio_mem_device_realize(DeviceState *dev,
> Error **errp)
> error_setg(errp, "'%s' property specifies an unsupported memdev",
> VIRTIO_MEM_MEMDEV_PROP);
> return;
> + } else if (vmem->memdev->prealloc) {
> + error_setg(errp, "'%s' property specifies a memdev with
> preallocation"
> + " enabled: %s. Instead, specify 'prealloc=on' for the"
> + " virtio-mem device. ", VIRTIO_MEM_MEMDEV_PROP,
> +
> object_get_canonical_path_component(OBJECT(vmem->memdev)));
> + return;
> }
>
> if ((nb_numa_nodes && vmem->node >= nb_numa_nodes) ||
> --
> 2.39.0
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
- Re: [PATCH v3 3/8] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM), (continued)
- Re: [PATCH v3 3/8] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM), Peter Xu, 2023/01/13
- Re: [PATCH v3 3/8] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM), Peter Xu, 2023/01/13
- Re: [PATCH v3 3/8] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM), David Hildenbrand, 2023/01/16
- Re: [PATCH v3 3/8] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM), Peter Xu, 2023/01/16
- Re: [PATCH v3 3/8] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM), David Hildenbrand, 2023/01/16
- Re: [PATCH v3 3/8] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM), David Hildenbrand, 2023/01/13
[PATCH v3 4/8] migration/vmstate: Introduce VMSTATE_WITH_TMP_TEST() and VMSTATE_BITMAP_TEST(), David Hildenbrand, 2023/01/12
[PATCH v3 5/8] migration/ram: Factor out check for advised postcopy, David Hildenbrand, 2023/01/12
[PATCH v3 6/8] virtio-mem: Fail if a memory backend with "prealloc=on" is specified, David Hildenbrand, 2023/01/12
- Re: [PATCH v3 6/8] virtio-mem: Fail if a memory backend with "prealloc=on" is specified,
Dr. David Alan Gilbert <=
[PATCH v3 7/8] virtio-mem: Migrate immutable properties early, David Hildenbrand, 2023/01/12
[PATCH v3 8/8] virtio-mem: Proper support for preallocation with migration, David Hildenbrand, 2023/01/12
Re: [PATCH v3 0/8] virtio-mem: Handle preallocation with migration, David Hildenbrand, 2023/01/12