[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACGkMEsgs3YjeeW9Ji5AcVcL4_qs8PAD7+uQ-P3H7MGYRKpEcw@mail.gmail.com>
Date: Wed, 22 May 2024 11:41:26 +0800
From: Jason Wang <jasowang@...hat.com>
To: Steven Sistare <steven.sistare@...cle.com>
Cc: virtualization@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
"Michael S. Tsirkin" <mst@...hat.com>, Si-Wei Liu <si-wei.liu@...cle.com>,
Eugenio Perez Martin <eperezma@...hat.com>, Xie Yongji <xieyongji@...edance.com>,
Stefano Garzarella <sgarzare@...hat.com>
Subject: Re: [PATCH V3 1/3] vhost-vdpa: flush workers on suspend
On Tue, May 21, 2024 at 9:39 PM Steven Sistare
<steven.sistare@...cle.com> wrote:
>
> On 5/20/2024 10:28 PM, Jason Wang wrote:
> > On Mon, May 20, 2024 at 11:21 PM Steve Sistare
> > <steven.sistare@...cle.com> wrote:
> >>
> >> Flush to guarantee no workers are running when suspend returns.
> >>
> >> Fixes: f345a0143b4d ("vhost-vdpa: uAPI to suspend the device")
> >> Signed-off-by: Steve Sistare <steven.sistare@...cle.com>
> >> Acked-by: Eugenio Pérez <eperezma@...hat.com>
> >> ---
> >> drivers/vhost/vdpa.c | 3 +++
> >> 1 file changed, 3 insertions(+)
> >>
> >> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> >> index ba52d128aeb7..189596caaec9 100644
> >> --- a/drivers/vhost/vdpa.c
> >> +++ b/drivers/vhost/vdpa.c
> >> @@ -594,6 +594,7 @@ static long vhost_vdpa_suspend(struct vhost_vdpa *v)
> >> struct vdpa_device *vdpa = v->vdpa;
> >> const struct vdpa_config_ops *ops = vdpa->config;
> >> int ret;
> >> + struct vhost_dev *vdev = &v->vdev;
> >>
> >> if (!(ops->get_status(vdpa) & VIRTIO_CONFIG_S_DRIVER_OK))
> >> return 0;
> >> @@ -601,6 +602,8 @@ static long vhost_vdpa_suspend(struct vhost_vdpa *v)
> >> if (!ops->suspend)
> >> return -EOPNOTSUPP;
> >>
> >> + vhost_dev_flush(vdev);
> >
> > vhost-vDPA doesn't use workers, see:
> >
> > vhost_dev_init(dev, vqs, nvqs, 0, 0, 0, false,
> > vhost_vdpa_process_iotlb_msg);
> >
> > So I wonder if this is a must.
>
> True, but I am adding this to be future proof. I could instead log a warning
> or an error message if vhost_vdpa_suspend is called and v->vdev.use_worker=true,
> but IMO we should just fix it, given that the fix is trivial.
I meant we need to know if it fixes any actual issue or not.
Thanks
>
> - Steve
>
>
>
Powered by blists - more mailing lists