qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Doug Goldstein <cardoe@cardoe.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH 2/2] virtio: disable notifications again after poll succeeded
Date: Thu, 12 Jan 2017 11:46:11 +0000	[thread overview]
Message-ID: <20170112114612.14520-3-stefanha@redhat.com> (raw)
In-Reply-To: <20170112114612.14520-1-stefanha@redhat.com>

While AioContext is in polling mode virtqueue notifications are not
necessary.  Some device virtqueue handlers enable notifications.  Make
sure they stay disabled to avoid unnecessary vmexits.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/virtio/virtio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index f04ab7a..34065c7 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2126,6 +2126,9 @@ static bool virtio_queue_host_notifier_aio_poll(void *opaque)
     }
 
     virtio_queue_notify_aio_vq(vq);
+
+    /* In case the handler function re-enabled notifications */
+    virtio_queue_set_notification(vq, 0);
     return true;
 }
 
-- 
2.9.3

  parent reply	other threads:[~2017-01-12 13:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12 11:46 [Qemu-devel] [PATCH 0/2] virtio: revert virtio_queue_set_notification() nesting Stefan Hajnoczi
2017-01-12 11:46 ` [Qemu-devel] [PATCH 1/2] Revert "virtio: turn vq->notification into a nested counter" Stefan Hajnoczi
2017-01-12 11:46 ` Stefan Hajnoczi [this message]
2017-01-13 15:53   ` [Qemu-devel] [PATCH 2/2] virtio: disable notifications again after poll succeeded Michael S. Tsirkin
2017-01-12 16:57 ` [Qemu-devel] [PATCH 0/2] virtio: revert virtio_queue_set_notification() nesting Doug Goldstein
2017-01-12 20:05   ` Michael S. Tsirkin
2017-01-13 14:48     ` Doug Goldstein
2017-01-13 12:02   ` Stefan Hajnoczi
2017-01-13 15:15     ` Doug Goldstein
2017-01-16 10:46       ` Stefan Hajnoczi
2017-01-16 21:03         ` Doug Goldstein
2017-01-17  3:09           ` Michael S. Tsirkin
2017-01-17  9:49           ` Stefan Hajnoczi
2017-01-14  3:48 ` Richard Henderson
2017-01-16 23:31 ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170112114612.14520-3-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=cardoe@cardoe.com \
    --cc=dgilbert@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).