From: Coly Li <i@coly.li>
To: Andreas Schwab <schwab@redhat.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
Coly Li <bosong.ly@taobao.com>,
David Daney <ddaney@caviumnetworks.com>,
linux-kernel@vger.kernel.org, Yong Zhang <yong.zhang0@gmail.com>,
David Laight <David.Laight@ACULAB.COM>,
Wang Cong <xiyou.wangcong@gmail.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/7] PowerPC: add unlikely() to BUG_ON()
Date: Fri, 28 Jan 2011 19:02:19 +0800 [thread overview]
Message-ID: <4D42A23B.4090302@coly.li> (raw)
In-Reply-To: <m31v3xxrlz.fsf@redhat.com>
On 2011年01月28日 18:14, Andreas Schwab Wrote:
> "David Laight"<David.Laight@ACULAB.COM> writes:
>
>> Also, as (I think) in some of the generated code quoted,
>> use of __builtin_expect() with a boolean expression can
>> force some versions of gcc to generate the integer
>> value of the expression
>
> That's more likely a side effect of the definition of likely/unlikely:
> they expand to !!(x).
>
It seems whether or not using unlikely() inside arch implemented BUG_ON() is arch dependent. Maybe a reasonable method
to use BUG_ON() is,
1) do not explicitly use unlikely() when using macro BUG_ON().
2) whether or not using unlikely() inside BUG_ON(), it depends on the implementation of BUG_ON(), including arch
implementation.
So from current feed back, doing "unlikely() optimization" here doesn't make anything better.
Thanks for all of your feed back :-)
--
Coly Li
prev parent reply other threads:[~2011-01-28 10:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1296130356-29896-1-git-send-email-bosong.ly@taobao.com>
[not found] ` <1296130356-29896-3-git-send-email-bosong.ly@taobao.com>
2011-01-27 17:57 ` [PATCH 2/7] PowerPC: add unlikely() to BUG_ON() David Daney
2011-01-27 20:04 ` Scott Wood
2011-01-27 20:32 ` David Daney
2011-01-28 9:05 ` David Laight
[not found] ` <AE90C24D6B3A694183C094C60CF0A2F6D8AC2D__37237.0892241181$1296205746$gmane$org@saturn3.aculab.com>
2011-01-28 10:14 ` Andreas Schwab
2011-01-28 11:02 ` Coly Li [this message]
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=4D42A23B.4090302@coly.li \
--to=i@coly.li \
--cc=David.Laight@ACULAB.COM \
--cc=bosong.ly@taobao.com \
--cc=ddaney@caviumnetworks.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=schwab@redhat.com \
--cc=xiyou.wangcong@gmail.com \
--cc=yong.zhang0@gmail.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).