From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Richardson, Bruce" <bruce.richardson@intel.com>,
Ivan Boule <ivan.boule@6wind.com>
Cc: Jerin Jacob <jerin.jacob@caviumnetworks.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add packet data prefetch in macswap loop
Date: Tue, 10 May 2016 12:26:45 +0000 [thread overview]
Message-ID: <2601191342CEEE43887BDE71AB97725836B4F355@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <20160503102021.GB15716@bricha3-MOBL3>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Tuesday, May 03, 2016 11:20 AM
> To: Ivan Boule
> Cc: Jerin Jacob; dev@dpdk.org; De Lara Guarch, Pablo
> Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add packet data prefetch in macswap loop
>
> On Tue, May 03, 2016 at 11:50:31AM +0200, Ivan Boule wrote:
> > On 05/03/2016 11:45 AM, Bruce Richardson wrote:
> > >On Mon, May 02, 2016 at 05:29:37PM +0530, Jerin Jacob wrote:
> > >>prefetch the next packet data address in advance in macswap loop
> > >>for performance improvement.
> > >>
> > >>...
> > >> for (i = 0; i < nb_rx; i++) {
> > >>+ if (likely(i < nb_rx - 1))
> > >>+ rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1],
> > >>+ void *));
> > >
> > >At least on IA platforms, there is no issue with prefetching beyond the end of
> > >the array, since it's only a hint to the cpu. If this is true for other platforms,
> > >then I suggest we just drop the conditional and just always prefetch.
> >
> > This is an interesting point.
> > Bruce, are you suggesting that prefetching at an invalid [virtual] address
> > won't trigger a CPU exception?
> >
>
> Yep. For example, adding "rte_prefetch0(NULL)" at the start of main in testpmd
> causes no ill effects when running the app.
>
One correction - while on IA prefetch(inval_addr) wouldn't cause any functional problems,
it still might cause DTLB miss and can be a source of noticeable performance degradation.
So it is better to avoid such constructions for performance critical code.
Konstantin
next prev parent reply other threads:[~2016-05-10 12:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-02 11:59 Jerin Jacob
2016-05-02 17:48 ` De Lara Guarch, Pablo
2016-05-03 12:46 ` Jerin Jacob
2016-05-03 9:45 ` Bruce Richardson
2016-05-03 9:48 ` De Lara Guarch, Pablo
2016-05-03 10:16 ` Bruce Richardson
2016-05-03 9:50 ` Ivan Boule
2016-05-03 10:20 ` Bruce Richardson
2016-05-10 12:26 ` Ananyev, Konstantin [this message]
2016-05-03 14:07 ` [dpdk-dev] [PATCH v2] app/testpmd: add packet data pointer prefetch in the forwarding loop Jerin Jacob
2016-05-03 14:33 ` Thomas Monjalon
2016-06-07 11:19 ` De Lara Guarch, Pablo
2016-06-08 15:57 ` Thomas Monjalon
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=2601191342CEEE43887BDE71AB97725836B4F355@irsmsx105.ger.corp.intel.com \
--to=konstantin.ananyev@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=ivan.boule@6wind.com \
--cc=jerin.jacob@caviumnetworks.com \
--cc=pablo.de.lara.guarch@intel.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).