[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 18/40] vdpa: unregister listener on last dev cleanup
From: |
Eugenio Perez Martin |
Subject: |
Re: [PATCH 18/40] vdpa: unregister listener on last dev cleanup |
Date: |
Mon, 11 Dec 2023 18:37:25 +0100 |
On Thu, Dec 7, 2023 at 7:50 PM Si-Wei Liu <si-wei.liu@oracle.com> wrote:
>
> So that the free of iova tree struct can be safely deferred to
> until the last vq referencing it goes away.
>
I think this patch message went out of sync too.
> Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
> ---
> hw/virtio/vhost-vdpa.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
> index 4f026db..ea2dfc8 100644
> --- a/hw/virtio/vhost-vdpa.c
> +++ b/hw/virtio/vhost-vdpa.c
> @@ -815,7 +815,10 @@ static int vhost_vdpa_cleanup(struct vhost_dev *dev)
> }
>
> vhost_vdpa_host_notifiers_uninit(dev, dev->nvqs);
> - memory_listener_unregister(&v->shared->listener);
> + if (vhost_vdpa_last_dev(dev) && v->shared->listener_registered) {
> + memory_listener_unregister(&v->shared->listener);
> + v->shared->listener_registered = false;
> + }
I think this version is more correct, but it should not matter as the
device cleanup implies the device will not be used anymore, isn't it?
Or am I missing something?
> vhost_vdpa_svq_cleanup(dev);
>
> dev->opaque = NULL;
> --
> 1.8.3.1
>
- [PATCH 13/40] vdpa: ref counting VhostVDPAShared, (continued)
- [PATCH 13/40] vdpa: ref counting VhostVDPAShared, Si-Wei Liu, 2023/12/07
- [PATCH 14/40] vdpa: convert iova_tree to ref count based, Si-Wei Liu, 2023/12/07
- [PATCH 15/40] vdpa: add svq_switching and flush_map to header, Si-Wei Liu, 2023/12/07
- [PATCH 12/40] vdpa: check map_thread_enabled before join maps thread, Si-Wei Liu, 2023/12/07
- [PATCH 11/40] vdpa: factor out vhost_vdpa_last_dev, Si-Wei Liu, 2023/12/07
- [PATCH 17/40] vdpa: judge if map can be kept across reset, Si-Wei Liu, 2023/12/07
- [PATCH 18/40] vdpa: unregister listener on last dev cleanup, Si-Wei Liu, 2023/12/07
- Re: [PATCH 18/40] vdpa: unregister listener on last dev cleanup,
Eugenio Perez Martin <=
- [PATCH 08/40] vdpa: add back vhost_vdpa_net_first_nc_vdpa, Si-Wei Liu, 2023/12/07
- [PATCH 22/40] vdpa: factor out vhost_vdpa_map_batch_begin, Si-Wei Liu, 2023/12/07
- [PATCH 25/40] vdpa: add asid to dma_batch_once API, Si-Wei Liu, 2023/12/07
- [PATCH 19/40] vdpa: should avoid map flushing with persistent iotlb, Si-Wei Liu, 2023/12/07
- [PATCH 21/40] vdpa: vhost_vdpa_dma_batch_end_once rename, Si-Wei Liu, 2023/12/07
- [PATCH 16/40] vdpa: indicate SVQ switching via flag, Si-Wei Liu, 2023/12/07
- [PATCH 24/40] vdpa: factor out vhost_vdpa_dma_batch_end, Si-Wei Liu, 2023/12/07
- [PATCH 26/40] vdpa: return int for dma_batch_once API, Si-Wei Liu, 2023/12/07