[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] virtio-scsi: dataplane: suppress guest notifica
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] virtio-scsi: dataplane: suppress guest notification |
Date: |
Wed, 12 Nov 2014 11:19:36 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
On 12/11/2014 04:24, Ming Lei wrote:
> 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 <address@hidden>
> Signed-off-by: Ming Lei <address@hidden>
> ---
> hw/scsi/virtio-scsi-dataplane.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c
> index df17229..be3b042 100644
> --- a/hw/scsi/virtio-scsi-dataplane.c
> +++ b/hw/scsi/virtio-scsi-dataplane.c
> @@ -93,9 +93,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)
>
Thanks, applied.
Paolo