From: Ingo Molnar <mingo@kernel.org>
To: David Laight <David.Laight@ACULAB.COM>
Cc: Neil Horman <nhorman@tuxdriver.com>,
Joe Perches <joe@perches.com>, netdev <netdev@vger.kernel.org>,
Dave Jones <davej@redhat.com>,
linux-kernel@vger.kernel.org, sebastien.dugue@bull.net,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Eric Dumazet <eric.dumazet@gmail.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [Fwd: Re: [PATCH v2 2/2] x86: add prefetching to do_csum]
Date: Wed, 13 Nov 2013 14:53:09 +0100 [thread overview]
Message-ID: <20131113135309.GA27006@gmail.com> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B7412@saturn3.aculab.com>
* David Laight <David.Laight@ACULAB.COM> wrote:
> > > I'm not sure, whats the typical capacity for the branch predictors
> > > ability to remember code paths?
> ...
> >
> > For such simple single-target branches it goes near or over a thousand
> > for recent Intel and AMD microarchitectures. Thousands for really
> > recent CPUs.
>
> IIRC the x86 can also correctly predict simple sequences - like a branch
> in a loop that is taken every other iteration, or only after a previous
> branch is taken.
They tend to be rather capable but not very well documented :) With a
large out of order execution design and 20+ pipeline stages x86 branch
prediction accuracy is perhaps the most important design aspect to good
CPU performance.
> Much simpler cpus may use a much simpler strategy.
Yeah. The patches in this thread are about the x86 assembly implementation
of the csum routines, and for 'typical' x86 CPUs the branch prediction
units and caches are certainly sophisticated enough.
Also note that here, for real usecases, the csum routines are (or should
be) memory bandwidth limited, missing the data cache most of the time,
with a partially idling pipeline, while branch prediction accuracy matters
most when the pipeline is well fed and there are a lot of instructions in
flight.
Thanks,
Ingo
next prev parent reply other threads:[~2013-11-13 13:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-12 1:42 [Fwd: Re: [PATCH v2 2/2] x86: add prefetching to do_csum] Joe Perches
2013-11-12 13:59 ` Neil Horman
2013-11-12 17:12 ` Neil Horman
2013-11-12 17:33 ` Joe Perches
2013-11-12 19:50 ` Neil Horman
2013-11-12 20:38 ` Joe Perches
2013-11-12 20:59 ` Neil Horman
2013-11-13 10:09 ` David Laight
2013-11-13 12:30 ` Neil Horman
2013-11-13 13:08 ` Ingo Molnar
2013-11-13 13:32 ` David Laight
2013-11-13 13:53 ` Ingo Molnar [this message]
2013-11-13 16:01 ` Neil Horman
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=20131113135309.GA27006@gmail.com \
--to=mingo@kernel.org \
--cc=David.Laight@ACULAB.COM \
--cc=a.p.zijlstra@chello.nl \
--cc=davej@redhat.com \
--cc=eric.dumazet@gmail.com \
--cc=hpa@zytor.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=sebastien.dugue@bull.net \
--cc=tglx@linutronix.de \
--cc=x86@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).