From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoV1j-0001l6-1s for qemu-devel@nongnu.org; Wed, 12 Nov 2014 05:19:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoV1e-00040N-3w for qemu-devel@nongnu.org; Wed, 12 Nov 2014 05:19:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoV1d-00040J-TV for qemu-devel@nongnu.org; Wed, 12 Nov 2014 05:19:46 -0500 Message-ID: <54633438.3000109@redhat.com> Date: Wed, 12 Nov 2014 11:19:36 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1415762675-11237-1-git-send-email-ming.lei@canonical.com> In-Reply-To: <1415762675-11237-1-git-send-email-ming.lei@canonical.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio-scsi: dataplane: suppress guest notification List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei , qemu-devel@nongnu.org, Stefan Hajnoczi , Kevin Wolf Cc: Fam Zheng , Anthony Liguori , "Michael S. Tsirkin" 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 > Signed-off-by: Ming Lei > --- > 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