public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: linux-kernel@vger.kernel.org
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Mitchell Blank Jr <mitch@sfgoth.com>, Andi Kleen <ak@suse.de>,
	"David S. Miller" <davem@davemloft.net>,
	rml@novell.com, akpm@osdl.org
Subject: Re: [patch] IBM HDAPS accelerometer driver, with probing.
Date: Sat, 27 Aug 2005 01:12:50 -0500	[thread overview]
Message-ID: <200508270112.50947.dtor_core@ameritech.net> (raw)
In-Reply-To: <20050827053359.GB15782@mandriva.com>

On Saturday 27 August 2005 00:34, Arnaldo Carvalho de Melo wrote:
> Em Fri, Aug 26, 2005 at 09:06:22PM -0700, Mitchell Blank Jr escreveu:
> > Andi Kleen wrote:
> > > - it doesn't seem to help that much on modern CPUs with good
> > > branch prediction and big icaches anyways.
> > 
> > Really?  I would think that as pipelines get deeper (although that trend
> > seems to have stopped, thankfully) and Icache-miss penalties get relatively
> > larger we'd see unlikely() becoming MORE of a benefit, not less.  Storing
> > the used part of a "hot" function in 1 Icacheline instead of 4 seems like
> > an obvious win.
> > 
> > Personally I've never found unlikely() to be ugly; if anything I think
> > it serves as a nice little human-readable comment about whats going on
> > in the control-flow.  I guess I'm in the minority on that one, though.
> 
> Hey, even if unlikely was:
> 
> #define unlikely(x) (x)
> 
> I'd find it useful :-)
>

Aside from annotating performance-critical sections what other purpose
would it carry? It's not like you should not pay attention to teh code
in these branches even if the are unlikely to be taken. So if code is
not in hot path likely/unlikely just litter the code.

Btw, does it actually generate smaller code for constructs like

	if (unlikely(blah))
		goto out;

-- 
Dmitry

  reply	other threads:[~2005-08-27  6:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-26 22:18 [patch] IBM HDAPS accelerometer driver, with probing Robert Love
2005-08-26 22:44 ` Dmitry Torokhov
2005-08-26 23:37   ` Robert Love
2005-08-27  5:29     ` Arnaldo Carvalho de Melo
2005-08-27 14:45       ` Alan Cox
2005-08-26 22:58 ` Alexey Dobriyan
2005-08-26 23:15   ` David S. Miller
2005-08-27  2:34     ` Andi Kleen
2005-08-27  2:49       ` David S. Miller
2005-08-27  4:06       ` Mitchell Blank Jr
2005-08-27  5:34         ` Arnaldo Carvalho de Melo
2005-08-27  6:12           ` Dmitry Torokhov [this message]
2005-08-27 11:35             ` Alexey Dobriyan
2005-08-27 14:56               ` Andi Kleen

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=200508270112.50947.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=acme@ghostprotocols.net \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mitch@sfgoth.com \
    --cc=rml@novell.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