netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: brouer@redhat.com
Cc: netdev@vger.kernel.org
Subject: Re: [net-next PATCH] net: help compiler generate better code in eth_get_headlen
Date: Mon, 28 Sep 2015 22:51:38 -0700 (PDT)	[thread overview]
Message-ID: <20150928.225138.363029814550861853.davem@davemloft.net> (raw)
In-Reply-To: <20150928104713.12016.65491.stgit@canyon>

 From: Jesper Dangaard Brouer <brouer@redhat.com>
Date: Mon, 28 Sep 2015 12:47:14 +0200

> Noticed that the compiler (gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC))
> generated suboptimal assembler code in eth_get_headlen().
> 
> This early return coding style is usually not an issue, on super scalar CPUs,
> but the compiler choose to put the return statement after this very unlikely
> branch, thus creating larger jump down to the likely code path.
> 
> Performance wise, I could measure slightly less L1-icache-load-misses
> and less branch-misses, and an improvement of 1 nanosec with an IP-forwarding
> use-case with 257 bytes packets with ixgbe (CPU i7-4790K @ 4.00GHz).
> 
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>

Applied, thanks Jesper.

      reply	other threads:[~2015-09-29  5:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-28 10:47 [net-next PATCH] net: help compiler generate better code in eth_get_headlen Jesper Dangaard Brouer
2015-09-29  5:51 ` David Miller [this message]

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=20150928.225138.363029814550861853.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=brouer@redhat.com \
    --cc=netdev@vger.kernel.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).