summaryrefslogtreecommitdiff
path: root/drivers/vhost
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2022-05-17 13:08:44 -0500
committerMichael S. Tsirkin <mst@redhat.com>2022-05-31 12:45:10 -0400
commit6ca84326c283e2f5d4ea920dec6f9d4272e4d124 (patch)
tree381242428c4d76a6b1a39f93c7e6d6a302b24086 /drivers/vhost
parent6fcf224c379f07c73fb972007c93db8c05d930d7 (diff)
vhost: flush dev once during vhost_dev_stop
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 <michael.christie@oracle.com> Acked-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Message-Id: <20220517180850.198915-3-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost')
-rw-r--r--drivers/vhost/vhost.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 43f6ac2d21cd..d82b9394d89a 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(&dev->vqs[i]->poll);
- vhost_work_dev_flush(dev->vqs[i]->poll.dev);
- }
}
+
+ vhost_work_dev_flush(dev);
}
EXPORT_SYMBOL_GPL(vhost_dev_stop);