diff options
author | Ming Lei <ming.lei@canonical.com> | 2014-11-12 11:24:35 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-11-12 11:19:19 +0100 |
commit | 6012ca8159a7f78e6fc5122a8e9f22d82e9723e9 (patch) | |
tree | af270b68589341666fab9dbd052a41d48b8a0cc3 /hw/scsi/virtio-scsi-dataplane.c | |
parent | c9cf45c1a475e594c560862d9df35b16e3a42702 (diff) | |
download | qemu-6012ca8159a7f78e6fc5122a8e9f22d82e9723e9.tar.gz qemu-6012ca8159a7f78e6fc5122a8e9f22d82e9723e9.tar.bz2 qemu-6012ca8159a7f78e6fc5122a8e9f22d82e9723e9.zip |
virtio-scsi: dataplane: suppress guest notification
This patch uses vring_should_notify() to suppress
guest notification, and looks notification frequency
can be decreased from ~33K/sec to ~2K/sec in my test
environment.
Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi/virtio-scsi-dataplane.c')
-rw-r--r-- | hw/scsi/virtio-scsi-dataplane.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c index 969b931557..03a1e8cfcf 100644 --- a/hw/scsi/virtio-scsi-dataplane.c +++ b/hw/scsi/virtio-scsi-dataplane.c @@ -92,9 +92,14 @@ VirtIOSCSIReq *virtio_scsi_pop_req_vring(VirtIOSCSI *s, void virtio_scsi_vring_push_notify(VirtIOSCSIReq *req) { + VirtIODevice *vdev = VIRTIO_DEVICE(req->vring->parent); + vring_push(&req->vring->vring, &req->elem, req->qsgl.size + req->resp_iov.size); - event_notifier_set(&req->vring->guest_notifier); + + if (vring_should_notify(vdev, &req->vring->vring)) { + event_notifier_set(&req->vring->guest_notifier); + } } static void virtio_scsi_iothread_handle_ctrl(EventNotifier *notifier) |