virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Mike Christie <michael.christie@oracle.com>,
	stefanha@redhat.com, mst@redhat.com, sgarzare@redhat.com,
	virtualization@lists.linux-foundation.org, arbn@yandex-team.com
Subject: Re: [PATCH V2 4/8] vhost_test: remove vhost_test_flush_vq()
Date: Tue, 17 May 2022 11:23:20 +0800	[thread overview]
Message-ID: <5db0fe9b-2bfc-31dc-e2b1-007f20f6acf2@redhat.com> (raw)
In-Reply-To: <20220515202922.174066-5-michael.christie@oracle.com>


在 2022/5/16 04:29, Mike Christie 写道:
> From: Andrey Ryabinin <arbn@yandex-team.com>
>
> vhost_test_flush_vq() just a simple wrapper around vhost_work_dev_flush()
> which seems have no value. It's just easier to call vhost_work_dev_flush()
> directly. Besides there is no point in obtaining vhost_dev pointer
> via 'n->vqs[index].poll.dev' while we can just use &n->dev.
> It's the same pointers, see vhost_test_open()/vhost_dev_init().
>
> Signed-off-by: Andrey Ryabinin <arbn@yandex-team.com>
> Signed-off-by: Mike Christie <michael.christie@oracle.com>


Acked-by: Jason Wang <jasowang@redhat.com>


> ---
>   drivers/vhost/test.c | 11 +++--------
>   1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c
> index f0ac9e35f5d6..837148d0a6a8 100644
> --- a/drivers/vhost/test.c
> +++ b/drivers/vhost/test.c
> @@ -144,14 +144,9 @@ static void vhost_test_stop(struct vhost_test *n, void **privatep)
>   	*privatep = vhost_test_stop_vq(n, n->vqs + VHOST_TEST_VQ);
>   }
>   
> -static void vhost_test_flush_vq(struct vhost_test *n, int index)
> -{
> -	vhost_work_dev_flush(n->vqs[index].poll.dev);
> -}
> -
>   static void vhost_test_flush(struct vhost_test *n)
>   {
> -	vhost_test_flush_vq(n, VHOST_TEST_VQ);
> +	vhost_work_dev_flush(&n->dev);
>   }
>   
>   static int vhost_test_release(struct inode *inode, struct file *f)
> @@ -210,7 +205,7 @@ static long vhost_test_run(struct vhost_test *n, int test)
>   			goto err;
>   
>   		if (oldpriv) {
> -			vhost_test_flush_vq(n, index);
> +			vhost_test_flush(n, index);
>   		}
>   	}
>   
> @@ -303,7 +298,7 @@ static long vhost_test_set_backend(struct vhost_test *n, unsigned index, int fd)
>   	mutex_unlock(&vq->mutex);
>   
>   	if (enable) {
> -		vhost_test_flush_vq(n, index);
> +		vhost_test_flush(n);
>   	}
>   
>   	mutex_unlock(&n->dev.mutex);

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2022-05-17  3:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-15 20:29 [PATCH V2 0/8] vhost flush cleanups Mike Christie
2022-05-15 20:29 ` [PATCH V2 1/8] vhost: get rid of vhost_poll_flush() wrapper Mike Christie
2022-05-17  3:14   ` Jason Wang
2022-05-17 13:56   ` Stefano Garzarella
2022-05-15 20:29 ` [PATCH V2 2/8] vhost: flush dev once during vhost_dev_stop Mike Christie
2022-05-17  3:16   ` Jason Wang
2022-05-17 13:57   ` Stefano Garzarella
2022-05-15 20:29 ` [PATCH V2 3/8] vhost_net: get rid of vhost_net_flush_vq() and extra flush calls Mike Christie
2022-05-17  3:22   ` Jason Wang
2022-05-17 14:06   ` Stefano Garzarella
2022-05-15 20:29 ` [PATCH V2 4/8] vhost_test: remove vhost_test_flush_vq() Mike Christie
2022-05-17  3:23   ` Jason Wang [this message]
2022-05-17 14:11   ` Stefano Garzarella
2022-05-17 16:54     ` Mike Christie
2022-05-15 20:29 ` [PATCH V2 5/8] vhost_vsock: simplify vhost_vsock_flush() Mike Christie
2022-05-17  3:23   ` Jason Wang
2022-05-15 20:29 ` [PATCH V2 6/8] vhost-scsi: drop flush after vhost_dev_cleanup Mike Christie
2022-05-15 20:29 ` [PATCH V2 7/8] vhost-test: " Mike Christie
2022-05-17  3:28   ` Jason Wang
2022-05-15 20:29 ` [PATCH V2 8/8] vhost: rename vhost_work_dev_flush Mike Christie
2022-05-17  3:28   ` Jason Wang
2022-05-17 14:18   ` Stefano Garzarella
2022-05-17  3:13 ` [PATCH V2 0/8] vhost flush cleanups Jason Wang
2022-05-17 14:20 ` Stefano Garzarella

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=5db0fe9b-2bfc-31dc-e2b1-007f20f6acf2@redhat.com \
    --to=jasowang@redhat.com \
    --cc=arbn@yandex-team.com \
    --cc=michael.christie@oracle.com \
    --cc=mst@redhat.com \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).