linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: alan@lxorguk.ukuu.org.uk, benh@kernel.crashing.org,
	akira2.iguchi@toshiba.co.jp, arnd@arndb.de,
	kou.ishizaki@toshiba.co.jp, linas@austin.ibm.com,
	linux-ide@vger.kernel.org, linuxppc-dev@ozlabs.org,
	paulus@samba.org
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



  reply	other threads:[~2007-01-17 16:49 UTC|newest]

Thread overview: 14+ 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
2007-01-18  0:55     ` Akira Iguchi
2007-01-18  1:29       ` [PATCH] driver/ata: PATA driver for Celleb Akira Iguchi
2007-01-25  1:20         ` Jeff Garzik
2007-01-25  3:45           ` Benjamin Herrenschmidt
2007-01-18  1:29       ` Akira Iguchi
2007-01-25  1:17       ` [PATCH 2/4] libata-core.c: add another IRQ calls Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2007-01-16 10:46 Akira Iguchi
2007-01-16 10:46 Akira Iguchi
2007-01-16 12:03 ` Alan
2007-01-16 22:04   ` Jeff Garzik

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.org \
    --cc=akira2.iguchi@toshiba.co.jp \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=kou.ishizaki@toshiba.co.jp \
    --cc=linas@austin.ibm.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mikpe@it.uu.se \
    --cc=paulus@samba.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).