mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Sistare <steven.sistare@oracle.com>
To: Jason Wang <jasowang@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Si-Wei Liu <si-wei.liu@oracle.com>,
	Eugenio Perez Martin <eperezma@redhat.com>,
	Xie Yongji <xieyongji@bytedance.com>,
	Stefano Garzarella <sgarzare@redhat.com>
Subject: Re: [PATCH V3 1/3] vhost-vdpa: flush workers on suspend
Date: Tue, 21 May 2024 09:38:29 -0400	[thread overview]
Message-ID: <c4b73d50-2896-4bcc-ae61-6d72f9471978@oracle.com> (raw)
In-Reply-To: <CACGkMEvhs_-wD4p-i2VCmQnmdNPLsH9FkhkGePB5LxZQf4B30A@mail.gmail.com>

On 5/20/2024 10:28 PM, Jason Wang wrote:
> On Mon, May 20, 2024 at 11:21 PM Steve Sistare
> <steven.sistare@oracle.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@oracle.com>
>> Acked-by: Eugenio Pérez <eperezma@redhat.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.

- Steve




  reply	other threads:[~2024-05-21 13:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-20 15:20 [PATCH V3 0/3] " Steve Sistare
2024-05-20 15:21 ` [PATCH V3 1/3] vhost-vdpa: " Steve Sistare
2024-05-21  2:28   ` Jason Wang
2024-05-21 13:38     ` Steven Sistare [this message]
2024-05-22  3:41       ` Jason Wang
2024-05-20 15:21 ` [PATCH V3 2/3] vduse: suspend Steve Sistare
2024-05-21  2:30   ` Jason Wang
2024-05-21 13:38     ` Steven Sistare
2024-05-22  3:40       ` Jason Wang
2024-05-20 15:21 ` [PATCH V3 3/3] vdpa_sim: flush workers on suspend Steve Sistare
2024-05-21  2:32   ` Jason Wang
2024-05-21 13:39     ` Steven Sistare
2024-05-22  3:39       ` Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4b73d50-2896-4bcc-ae61-6d72f9471978@oracle.com \
    --to=steven.sistare@oracle.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=sgarzare@redhat.com \
    --cc=si-wei.liu@oracle.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xieyongji@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®