mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-21 09:02:00 -06:00
virtio-blk: 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-8-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
0d9d86fb4d
commit
9ef9d40261
1 changed files with 12 additions and 6 deletions
|
@ -588,13 +588,19 @@ void virtio_blk_handle_vq(VirtIOBlock *s, VirtQueue *vq)
|
||||||
|
|
||||||
blk_io_plug(s->blk);
|
blk_io_plug(s->blk);
|
||||||
|
|
||||||
while ((req = virtio_blk_get_request(s, vq))) {
|
do {
|
||||||
if (virtio_blk_handle_request(req, &mrb)) {
|
virtio_queue_set_notification(vq, 0);
|
||||||
virtqueue_detach_element(req->vq, &req->elem, 0);
|
|
||||||
virtio_blk_free_request(req);
|
while ((req = virtio_blk_get_request(s, vq))) {
|
||||||
break;
|
if (virtio_blk_handle_request(req, &mrb)) {
|
||||||
|
virtqueue_detach_element(req->vq, &req->elem, 0);
|
||||||
|
virtio_blk_free_request(req);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
virtio_queue_set_notification(vq, 1);
|
||||||
|
} while (!virtio_queue_empty(vq));
|
||||||
|
|
||||||
if (mrb.num_reqs) {
|
if (mrb.num_reqs) {
|
||||||
virtio_blk_submit_multireq(s->blk, &mrb);
|
virtio_blk_submit_multireq(s->blk, &mrb);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue