From: Jeff Garzik <jeff@garzik.org>
To: Tejun Heo <htejun@gmail.com>
Cc: saeed bishara <saeed.bishara@gmail.com>,
linux-ide@vger.kernel.org, Saeed Bishara <saeed@marvell.com>,
Mark Lord <liml@rtr.ca>
Subject: Re: [PATCH 1/2] [libata] sata_mv: Remove PCI dependency
Date: Tue, 22 Jan 2008 23:04:59 -0500 [thread overview]
Message-ID: <4796BCEB.1090207@garzik.org> (raw)
In-Reply-To: <47944A51.2090504@gmail.com>
Tejun Heo wrote:
> Jeff Garzik wrote:
>> saeed bishara wrote:
>>> - if (unlikely(irq_stat & PCI_ERR)) {
>>> + if (unlikely(irq_stat & PCI_ERR) && HAS_PCI(host)) {
>>> mv_pci_error(host, mmio);
>>> handled = 1;
>>> goto out_unlock; /* skip all other HC irq handling */
>> the unlikely() should cover the entire expression.
>
> Hmm... I also sometimes hesitate about these things. I think when the
> first condition is unlikely but the latter isn't so, it's better to tell
> the compiler that the first part is unlikely and let it figure out the
> rest. Another thing is using unlikely on the return value of helper
> function like the following.
>
> static bool test_some_condition(arg)
> {
> return unlikely(unlikely_test_on_arg(arg));
> }
>
> I haven't looked at the generated code yet but hope the compiler can
> DTRT if the function body is visible when compiling. Has anyone played
> with these?
Think about the question being answered -- this is branch prediction.
After all tests in an 'if' are complete, the question is: do we take
this branch or not? (yes/no)
And while it is valid to note unlikely() as done above, it doesn't
necessarily give the compiler the best idea about how to predict the
ultimate end result of all the tests, which is the decision on whether
or not to take the branch.
Jeff
next prev parent reply other threads:[~2008-01-23 4:05 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-02 15:43 [PATCH 0/2] [libata] sata_mv: Add support for Marvell's integrated SATA controller saeed.bishara
2007-12-02 15:43 ` [PATCH 1/2] [libata] sata_mv: Remove PCI dependency saeed.bishara
2007-12-02 15:43 ` [PATCH 2/2] [libata] sata_mv: Support integrated controllers saeed.bishara
2007-12-18 22:02 ` Jeff Garzik
2007-12-18 21:57 ` [PATCH 1/2] [libata] sata_mv: Remove PCI dependency Jeff Garzik
2007-12-18 21:58 ` Jeff Garzik
2007-12-25 16:42 ` saeed bishara
2008-01-09 11:59 ` saeed bishara
2008-01-10 4:35 ` Jeff Garzik
2008-01-16 10:01 ` Jeff Garzik
2008-01-16 16:17 ` saeed bishara
2008-01-16 19:01 ` Mark Lord
2008-01-17 14:24 ` saeed bishara
2008-01-29 17:12 ` Jeff Garzik
2008-01-29 17:17 ` saeed bishara
2008-01-21 7:31 ` Tejun Heo
2008-01-23 4:04 ` Jeff Garzik [this message]
2008-01-23 4:15 ` Tejun Heo
2008-01-29 8:51 ` saeed bishara
2008-01-29 16:20 ` Mark Lord
2008-01-29 16:28 ` Jeff Garzik
2008-01-29 16:26 ` Jeff Garzik
-- strict thread matches above, loose matches on Subject: below --
2007-12-02 15:26 [PATCH 0/2] [libata] sata_mv: Add support for Marvell's integrated SATA controller saeed.bishara
2007-12-02 15:26 ` [PATCH 1/2] [libata] sata_mv: Remove PCI dependency saeed.bishara
2007-12-04 9:07 ` saeed bishara
2007-12-05 12:11 ` saeed bishara
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=4796BCEB.1090207@garzik.org \
--to=jeff@garzik.org \
--cc=htejun@gmail.com \
--cc=liml@rtr.ca \
--cc=linux-ide@vger.kernel.org \
--cc=saeed.bishara@gmail.com \
--cc=saeed@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.