From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XowVy-0004Zg-2Y for qemu-devel@nongnu.org; Thu, 13 Nov 2014 10:40:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XowVs-0007lx-80 for qemu-devel@nongnu.org; Thu, 13 Nov 2014 10:40:54 -0500 Received: from mail-wg0-x235.google.com ([2a00:1450:400c:c00::235]:39013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XowVr-0007lh-RK for qemu-devel@nongnu.org; Thu, 13 Nov 2014 10:40:48 -0500 Received: by mail-wg0-f53.google.com with SMTP id b13so17204454wgh.26 for ; Thu, 13 Nov 2014 07:40:47 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 13 Nov 2014 16:40:21 +0100 Message-Id: <1415893228-25823-7-git-send-email-pbonzini@redhat.com> In-Reply-To: <1415893228-25823-1-git-send-email-pbonzini@redhat.com> References: <1415893228-25823-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 06/13] virtio-scsi: dataplane: suppress guest notification List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Ming Lei From: Ming Lei 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 Signed-off-by: Paolo Bonzini --- 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 969b931..03a1e8c 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) -- 1.8.3.1