diff options
author | Jesper Dangaard Brouer <brouer@redhat.com> | 2015-09-28 10:47:14 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-29 05:51:15 (GMT) |
commit | 8a4683a5e06efda7e1f327213678d4dcafc0d894 (patch) | |
tree | f477f7b26896e0ed159aff107961a60ab2d11068 /net/ipv6/xfrm6_policy.c | |
parent | d2e1339f40db753286ca0a92c92a847e08c5d2de (diff) | |
download | linux-8a4683a5e06efda7e1f327213678d4dcafc0d894.tar.xz |
net: help compiler generate better code in eth_get_headlen
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/xfrm6_policy.c')
0 files changed, 0 insertions, 0 deletions