From: Jeff Garzik <jeff@garzik•org>
To: Mikael Pettersson <mikpe@it•uu.se>
Cc: arnd@arndb•de, linuxppc-dev@ozlabs•org,
linux-ide@vger•kernel.org, paulus@samba•org,
alan@lxorguk•ukuu.org.uk
Subject: Re: [PATCH 2/4] libata-core.c: add another IRQ calls
Date: Wed, 17 Jan 2007 11:49:34 -0500 [thread overview]
Message-ID: <45AE539E.2040600@garzik.org> (raw)
In-Reply-To: <200701170924.l0H9OsdG002754@harpo.it.uu.se>
Mikael Pettersson wrote:
> If there is a highly common case, the code for that case
> is available, and the code is cheap to execute (doesn't
> require too many additional variables), then having an
> explicit test + inline code is preferred. If any of these
> conditions isn't met, then I wouldn't bother converting
> the call to the if/inline/call combo.
To be a bit more specific, the branch being taken, or not, depends on
the system setup. For example, in sata_promise's case, with no other
SATA controllers in use,
if (ap->ops->irq_on)
ap->ops->irq_on(ap);
else
ata_irq_on(ap);
the direct function call will ALWAYS be called. But if you had a weird
system with both Cell and Promise PDC203xx, then the branch is dependent
on whether the activity comes from the Cell SATA or Promise SATA.
So it's highly predictable in a great many cases.
And it should be noted that it is a direct function call not inline,
thus its if/indirect/direct not if/indirect/inline.
Does that change the answer at all?
Jeff
next prev parent reply other threads:[~2007-01-17 16:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-17 9:24 [PATCH 2/4] libata-core.c: add another IRQ calls Mikael Pettersson
2007-01-17 16:49 ` Jeff Garzik [this message]
2007-01-17 20:31 ` Mikael Pettersson
2007-01-18 0:55 ` Akira Iguchi
[not found] ` <200701180055.l0I0tl6M021051@toshiba.co.jp>
2007-01-18 1:29 ` [PATCH] driver/ata: PATA driver for Celleb Akira Iguchi
2007-01-25 1:17 ` [PATCH 2/4] libata-core.c: add another IRQ calls Jeff Garzik
[not found] ` <200701180129.l0I1TL48013407@toshiba.co.jp>
2007-01-25 1:20 ` [PATCH] driver/ata: PATA driver for Celleb Jeff Garzik
2007-01-25 3:45 ` Benjamin Herrenschmidt
[not found] <200701161046.l0GAk5Go019691@toshiba.co.jp>
2007-01-16 12:03 ` [PATCH 2/4] libata-core.c: add another IRQ calls Alan
2007-01-16 22:04 ` Jeff Garzik
-- strict thread matches above, loose matches on Subject: below --
2007-01-16 10:46 Akira Iguchi
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=45AE539E.2040600@garzik.org \
--to=jeff@garzik$(echo .)org \
--cc=alan@lxorguk$(echo .)ukuu.org.uk \
--cc=arnd@arndb$(echo .)de \
--cc=linux-ide@vger$(echo .)kernel.org \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=mikpe@it$(echo .)uu.se \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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