qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Hu Yaohui <loki2441@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Virtio Polling Mode
Date: Sun, 29 Sep 2013 17:29:42 +0800	[thread overview]
Message-ID: <5247F306.6040002@redhat.com> (raw)
In-Reply-To: <CAHqbYQsKOwfBRRDWUL_ELUoQrMFRy_-2gQfWLH077aMcgJWExg@mail.gmail.com>

On 09/28/2013 02:56 AM, Hu Yaohui wrote:
> Hi All,
> I am wondering whether virtio has provided polling mode already.
> Instead of sending a event from guest to host through eventfd on guest
> side and inject an interrupt into guest on host side to notify each
> other? Could both sides keep polling the Vring to communicate with
> each other?
> Thanks for your time!
>

For virtio-net, both qemu and driver (at least Linux) mix using polling
and notification. Usually one side will disable the notification from
another side when it gets an interrupt, and then enter the polling mode
until no more buffers submitted from another side. After this it will
enable the interrupts again.

One of the method to improve this a little bit is to do the busy polling
even if there's no new buffers in case the other side will submit one or
more shortly. Linux has implemented this as low latency polling for
network stack (see http://lwn.net/Articles/551284/). It will do busy
polling for a time which can be configured by user. I've played a little
bit of this for both virtio-net and vhost, it can improves the latency
(more obvious for single session test) at the cost of extra cpu
overhead. The key to balance them is to choose time spent on busy
polling correctly. I don't think about it further but maybe we can make
it adaptive.
> Best Wishes,
> Yaohui

  parent reply	other threads:[~2013-09-29  9:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-27 18:56 [Qemu-devel] Virtio Polling Mode Hu Yaohui
2013-09-28 12:54 ` Anthony Liguori
2013-09-30 19:00   ` Hu Yaohui
2013-09-30 22:05     ` Anthony Liguori
2013-10-01  4:48       ` Hu Yaohui
2013-09-29  9:29 ` Jason Wang [this message]
2013-09-30 19:15   ` Hu Yaohui

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=5247F306.6040002@redhat.com \
    --to=jasowang@redhat.com \
    --cc=loki2441@gmail.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).