Re: [PATCH V2 2/8] vhost: flush dev once during vhost_dev_stop

2022-05-17 Thread Stefano Garzarella

On Sun, May 15, 2022 at 03:29:16PM -0500, Mike Christie wrote:

When vhost_work_dev_flush returns all work queued at that time will have
completed. There is then no need to flush after every vhost_poll_stop
call, and we can move the flush call to after the loop that stops the
pollers.

Signed-off-by: Mike Christie 
---
drivers/vhost/vhost.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)


Reviewed-by: Stefano Garzarella 

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


Re: [PATCH V2 2/8] vhost: flush dev once during vhost_dev_stop

2022-05-16 Thread Jason Wang


在 2022/5/16 04:29, Mike Christie 写道:

When vhost_work_dev_flush returns all work queued at that time will have
completed. There is then no need to flush after every vhost_poll_stop
call, and we can move the flush call to after the loop that stops the
pollers.

Signed-off-by: Mike Christie 



Acked-by: Jason Wang 



---
  drivers/vhost/vhost.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 1d84a2818c6f..9f8de04bb673 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -653,11 +653,11 @@ void vhost_dev_stop(struct vhost_dev *dev)
int i;
  
  	for (i = 0; i < dev->nvqs; ++i) {

-   if (dev->vqs[i]->kick && dev->vqs[i]->handle_kick) {
+   if (dev->vqs[i]->kick && dev->vqs[i]->handle_kick)
vhost_poll_stop(>vqs[i]->poll);
-   vhost_work_dev_flush(dev->vqs[i]->poll.dev);
-   }
}
+
+   vhost_work_dev_flush(dev);
  }
  EXPORT_SYMBOL_GPL(vhost_dev_stop);
  


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

[PATCH V2 2/8] vhost: flush dev once during vhost_dev_stop

2022-05-15 Thread Mike Christie
When vhost_work_dev_flush returns all work queued at that time will have
completed. There is then no need to flush after every vhost_poll_stop
call, and we can move the flush call to after the loop that stops the
pollers.

Signed-off-by: Mike Christie 
---
 drivers/vhost/vhost.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 1d84a2818c6f..9f8de04bb673 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -653,11 +653,11 @@ void vhost_dev_stop(struct vhost_dev *dev)
int i;
 
for (i = 0; i < dev->nvqs; ++i) {
-   if (dev->vqs[i]->kick && dev->vqs[i]->handle_kick) {
+   if (dev->vqs[i]->kick && dev->vqs[i]->handle_kick)
vhost_poll_stop(>vqs[i]->poll);
-   vhost_work_dev_flush(dev->vqs[i]->poll.dev);
-   }
}
+
+   vhost_work_dev_flush(dev);
 }
 EXPORT_SYMBOL_GPL(vhost_dev_stop);
 
-- 
2.25.1

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