From: Greg Kurz <gkurz@linux.vnet.ibm.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] virtio: optimize virtio_access_is_big_endian() for little-endian targets
Date: Fri, 13 Nov 2015 10:28:31 +0100 [thread overview]
Message-ID: <20151113102831.0459d0d9@bahia.local> (raw)
In-Reply-To: <20151112190859.74c49785.cornelia.huck@de.ibm.com>
On Thu, 12 Nov 2015 19:08:59 +0100
Cornelia Huck <cornelia.huck@de.ibm.com> wrote:
> On Mon, 09 Nov 2015 18:58:34 +0100
> Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
>
> > When adding cross-endian support, we introduced the TARGET_IS_BIENDIAN macro
> > and the virtio_access_is_big_endian() helper to have a branchless fast path
> > in the virtio memory accessors for targets that don't switch endian.
> >
> > This was considered as a strong requirement at the time.
> >
> > Now we have added a runtime check for virtio 1.0, which ruins the benefit
> > of the virtio_access_is_big_endian() helper for always little-endian targets.
> >
> > With this patch, fixed little-endian targets stop checking for virtio 1.0,
> > since the result is little-endian in all cases.
>
> So always-LE gets optimized, while always-BE and bi-endian stay the same?
>
Yes.
> (Is there a measurable impact?)
>
I tried to measure using iperf between host and guest but I could not
find any significant change... do you think about another test I could
try ?
> > The helper also gets renamed
> > so it is clear it is optimized for fast paths.
>
> Even if it isn't actually 'fast' on anything other than fixed-LE?
Yes this is definitely a fixed-LE only optimization... should I drop the name
change and add a comment instead ?
> >
> > Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> > ---
> > include/hw/virtio/virtio-access.h | 43 ++++++++++++++++++++-----------------
> > 1 file changed, 23 insertions(+), 20 deletions(-)
next prev parent reply other threads:[~2015-11-13 9:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 17:58 [Qemu-devel] [PATCH 0/3] virtio: cross-endian helpers fixes Greg Kurz
2015-11-09 17:58 ` [Qemu-devel] [PATCH 1/3] virtio: move cross-endian helper to vhost Greg Kurz
2015-11-12 18:00 ` Cornelia Huck
2015-11-13 8:28 ` Greg Kurz
2015-11-09 17:58 ` [Qemu-devel] [PATCH 2/3] vhost: move virtio 1.0 check to cross-endian helper Greg Kurz
2015-11-12 18:03 ` Cornelia Huck
2015-11-09 17:58 ` [Qemu-devel] [PATCH 3/3] virtio: optimize virtio_access_is_big_endian() for little-endian targets Greg Kurz
2015-11-12 18:08 ` Cornelia Huck
2015-11-13 9:28 ` Greg Kurz [this message]
2015-11-13 14:42 ` Cornelia Huck
2015-11-13 15:25 ` Greg Kurz
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=20151113102831.0459d0d9@bahia.local \
--to=gkurz@linux.vnet.ibm.com \
--cc=cornelia.huck@de.ibm.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).