From: Brian Gerst <brgerst@gmail.com>
To: aaron@assonance.org
Cc: Tim Blechmann <tim@klingt.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/5] branch hint tweaks
Date: Tue, 24 Nov 2009 13:59:27 -0500 [thread overview]
Message-ID: <73c1f2160911241059v66f89a3ep693e6967c3c5b8b3@mail.gmail.com> (raw)
In-Reply-To: <727e50150911241017h4bb1c0aex800e8c0ef7eee9fd@mail.gmail.com>
On Tue, Nov 24, 2009 at 1:17 PM, Aaron Cohen <remleduff@gmail.com> wrote:
> On Tue, Nov 24, 2009 at 12:50 PM, Brian Gerst <brgerst@gmail.com> wrote:
>> On Tue, Nov 24, 2009 at 5:54 AM, Tim Blechmann <tim@klingt.org> wrote:
>>> hi all,
>>>
>>> doing some branch hint profiling of 2.6.31 on my nehalem machine showed
>>> a few
>>> incorrect branch hints.
>>> these patches remove or change the branch hints
>>
>> I'm not sure what version of GCC added this, but I wonder if this
>> option will fix the problem:
>>
>> -fno-guess-branch-probability
>> Do not guess branch probabilities using heuristics.
>>
>> GCC will use heuristics to guess branch probabilities if they are
>> not provided by profiling feedback (-fprofile-arcs). These heuristics
>> are based on the control flow graph. If some branch probabilities are
>
> Is the kernel's use of unlikely typically intended to mean "I consider
> the following unlikely so please optimize with that expectation" or is
> meant to indicate "the following is a slow-path so please pessimize
> it" or both?
>
Both. It is meant to optimize static branch prediction (on x86,
forward branches are by default predicted not taken), and to reduce
icache footprint of infrequently used code in the main execution path.
If a section of code is marked unlikely(), GCC should put the code at
the end of the function.
--
Brian Gerst
next prev parent reply other threads:[~2009-11-24 18:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-24 10:54 Tim Blechmann
2009-11-24 17:50 ` Brian Gerst
2009-11-24 18:17 ` Aaron Cohen
2009-11-24 18:59 ` Brian Gerst [this message]
2009-11-24 18:21 ` Tim Blechmann
2009-11-24 20:13 ` Brian Gerst
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=73c1f2160911241059v66f89a3ep693e6967c3c5b8b3@mail.gmail.com \
--to=brgerst@gmail.com \
--cc=aaron@assonance.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tim@klingt.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
all inboxes | Powered by JetHome®