[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/14] virtio-blk: suppress virtqueue kick during pro
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 08/14] virtio-blk: suppress virtqueue kick during processing |
Date: |
Wed, 4 Jan 2017 13:34:08 +0000 |
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 <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
hw/block/virtio-blk.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 0c5fd27..50bb0cb 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -588,13 +588,19 @@ void virtio_blk_handle_vq(VirtIOBlock *s, VirtQueue *vq)
blk_io_plug(s->blk);
- while ((req = virtio_blk_get_request(s, vq))) {
- if (virtio_blk_handle_request(req, &mrb)) {
- virtqueue_detach_element(req->vq, &req->elem, 0);
- virtio_blk_free_request(req);
- break;
+ do {
+ virtio_queue_set_notification(vq, 0);
+
+ while ((req = virtio_blk_get_request(s, vq))) {
+ 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) {
virtio_blk_submit_multireq(s->blk, &mrb);
--
2.9.3
- [Qemu-devel] [PULL 00/14] Block patches, Stefan Hajnoczi, 2017/01/04
- [Qemu-devel] [PULL 02/14] aio: add flag to skip fds to aio_dispatch(), Stefan Hajnoczi, 2017/01/04
- [Qemu-devel] [PULL 01/14] HACKING: document #include order, Stefan Hajnoczi, 2017/01/04
- [Qemu-devel] [PULL 04/14] aio: add polling mode to AioContext, Stefan Hajnoczi, 2017/01/04
- [Qemu-devel] [PULL 06/14] linux-aio: poll ring for completions, Stefan Hajnoczi, 2017/01/04
- [Qemu-devel] [PULL 07/14] iothread: add polling parameters, Stefan Hajnoczi, 2017/01/04
- [Qemu-devel] [PULL 05/14] virtio: poll virtqueues for new buffers, Stefan Hajnoczi, 2017/01/04
- [Qemu-devel] [PULL 03/14] aio: add AioPollFn and io_poll() interface, Stefan Hajnoczi, 2017/01/04
- [Qemu-devel] [PULL 08/14] virtio-blk: suppress virtqueue kick during processing,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 09/14] virtio-scsi: suppress virtqueue kick during processing, Stefan Hajnoczi, 2017/01/04
- [Qemu-devel] [PULL 10/14] virtio: turn vq->notification into a nested counter, Stefan Hajnoczi, 2017/01/04
- [Qemu-devel] [PULL 12/14] virtio: disable virtqueue notifications during polling, Stefan Hajnoczi, 2017/01/04
- [Qemu-devel] [PULL 11/14] aio: add .io_poll_begin/end() callbacks, Stefan Hajnoczi, 2017/01/04
- [Qemu-devel] [PULL 13/14] aio: self-tune polling time, Stefan Hajnoczi, 2017/01/04
- [Qemu-devel] [PULL 14/14] iothread: add poll-grow and poll-shrink parameters, Stefan Hajnoczi, 2017/01/04
- Re: [Qemu-devel] [PULL 00/14] Block patches, Peter Maydell, 2017/01/05