mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@osdl.org>, Jeff Garzik <jeff@garzik.org>,
	linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: Re: [PATCH] ext3_clear_inode(): avoid kfree(NULL)
Date: Sat, 24 Jun 2006 14:27:39 +0200	[thread overview]
Message-ID: <1151152059.3181.37.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <Pine.LNX.4.58.0606240817170.23087@gandalf.stny.rr.com>

On Sat, 2006-06-24 at 08:20 -0400, Steven Rostedt wrote:
> On Sat, 24 Jun 2006, Arjan van de Ven wrote:
> 
> >
> > >
> > > Because at that callsite, NULL is the common case.  We avoid a do-nothing
> > > function call most of the time.  It's a nano-optimisation.
> >
> > but a function call is basically free, while an if () is not... even
> > with unlikely()...
> >
> > sounds like a misoptimization to me.
> >
> 
> How is a function call free when an if is not? 

in general, a function call is 100% predictable without any real control
flow dependencies for the processor, and thus there is no real issue in
the execution pipeline. An if is a conditional branch, which breaks up
the execution pipeline if mispredicted...

>  Especially if that
> function does the exact same if?

sure; 

but to call this code an optimization ... it's just extra code.



  reply	other threads:[~2006-06-24 12:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200606231502.k5NF2jfO007109@hera.kernel.org>
2006-06-23 18:51 ` Jeff Garzik
2006-06-23 21:24   ` Andrew Morton
2006-06-24 12:11     ` Arjan van de Ven
2006-06-24 12:20       ` Steven Rostedt
2006-06-24 12:27         ` Arjan van de Ven [this message]
2006-06-24 12:33           ` Steven Rostedt
2006-06-24 12:46             ` Arjan van de Ven
2006-06-24 12:51               ` Steven Rostedt
2006-06-24 12:53               ` Arjan van de Ven
2006-06-24 13:07                 ` Steven Rostedt
2006-06-24 14:11                   ` Arjan van de Ven
2006-06-24 16:06                     ` Nick Piggin
2006-06-24 16:49               ` Jeremy Fitzhardinge
2006-06-24 16:55                 ` Arjan van de Ven
2006-06-24 16:19       ` Pekka Enberg

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=1151152059.3181.37.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=akpm@osdl.org \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@osdl.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

all inboxes | Powered by JetHome®