DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Honnappa Nagarahalli" <Honnappa.Nagarahalli@arm.com>,
	"Olivier Matz" <olivier.matz@6wind.com>
Cc: <dev@dpdk.org>
Subject: Re: [dpdk-dev] rte_mbuf library likely()/unlikely()
Date: Mon, 23 Jul 2018 21:09:37 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35B421F1@smartserver.smartshare.dk> (raw)
In-Reply-To: <HE1PR0801MB1930747F372E5B543B4F273098560@HE1PR0801MB1930.eurprd08.prod.outlook.com>

I haven't performance tested, but they are compiler branch prediction hints pointing out the most likely execution path, so I expect them to have a positive effect.

E.g. the first comparison in __rte_pktmbuf_read() is very unlikely to be true - it would mean that the application is trying to read data beyond the packet.

Please also refer to:
https://cellperformance.beyond3d.com/articles/2006/04/branch-patterns-using-gcc.html


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Honnappa Nagarahalli
> Sent: Monday, July 23, 2018 7:52 PM
> To: Morten Brørup; Olivier Matz
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] rte_mbuf library likely()/unlikely()
> 
> Do you see any performance improvements with these changes?
> 
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Morten Brørup
> Sent: Monday, July 23, 2018 8:54 AM
> To: Olivier Matz <olivier.matz@6wind.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] rte_mbuf library likely()/unlikely()
> 
> Hi Olivier,
> 
> 
> 
> I noticed that __rte_pktmbuf_read() could do with an unlikely(), so I went
> through the entire library. Here are my suggested modifications.
> 

  reply	other threads:[~2018-07-23 19:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 13:53 Morten Brørup
2018-07-23 17:37 ` Stephen Hemminger
2018-07-23 18:59   ` Morten Brørup
2018-07-23 19:45     ` Stephen Hemminger
2018-07-23 17:51 ` Honnappa Nagarahalli
2018-07-23 19:09   ` Morten Brørup [this message]
2018-07-23 22:40     ` Wiles, Keith
2018-07-24  7:29       ` Olivier Matz
2018-07-24  8:13         ` Morten Brørup
2018-07-24 11:31           ` Van Haaren, Harry
2018-07-24 13:02             ` Wiles, Keith

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=98CBD80474FA8B44BF855DF32C47DC35B421F1@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    /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).