mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
virtio-scsi: suppress virtqueue kick during processing
The guest does not need to kick the virtqueue while we are processing it. This reduces the number of vmexits during periods of heavy I/O. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20161201192652.9509-9-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
9ef9d40261
commit
23425cc2b7
1 changed files with 21 additions and 15 deletions
|
@ -592,10 +592,13 @@ static void virtio_scsi_handle_cmd_req_submit(VirtIOSCSI *s, VirtIOSCSIReq *req)
|
||||||
void virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq)
|
void virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq)
|
||||||
{
|
{
|
||||||
VirtIOSCSIReq *req, *next;
|
VirtIOSCSIReq *req, *next;
|
||||||
int ret;
|
int ret = 0;
|
||||||
|
|
||||||
QTAILQ_HEAD(, VirtIOSCSIReq) reqs = QTAILQ_HEAD_INITIALIZER(reqs);
|
QTAILQ_HEAD(, VirtIOSCSIReq) reqs = QTAILQ_HEAD_INITIALIZER(reqs);
|
||||||
|
|
||||||
|
do {
|
||||||
|
virtio_queue_set_notification(vq, 0);
|
||||||
|
|
||||||
while ((req = virtio_scsi_pop_req(s, vq))) {
|
while ((req = virtio_scsi_pop_req(s, vq))) {
|
||||||
ret = virtio_scsi_handle_cmd_req_prepare(s, req);
|
ret = virtio_scsi_handle_cmd_req_prepare(s, req);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
|
@ -613,6 +616,9 @@ void virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtio_queue_set_notification(vq, 1);
|
||||||
|
} while (ret != -EINVAL && !virtio_queue_empty(vq));
|
||||||
|
|
||||||
QTAILQ_FOREACH_SAFE(req, &reqs, next, next) {
|
QTAILQ_FOREACH_SAFE(req, &reqs, next, next) {
|
||||||
virtio_scsi_handle_cmd_req_submit(s, req);
|
virtio_scsi_handle_cmd_req_submit(s, req);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue