mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 08:14:15 +08:00
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>
This commit is contained in:
parent
6fcf224c37
commit
6ca84326c2
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user