public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Roland McGrath <roland@redhat.com>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	Steven Rostedt <srostedt@redhat.com>,
	Christoph Lameter <cl@linux-foundation.org>,
	Matt Mackall <mpm@selenic.com>
Subject: Re: [PATCH 2/5] mm: remove unlikly NULL from kfree
Date: Wed, 25 Mar 2009 14:20:06 -0700	[thread overview]
Message-ID: <20090325142006.3ba0ee10.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.2.00.0903250840440.29264@localhost.localdomain>

On Wed, 25 Mar 2009 08:50:44 +0100 (CET) Thomas Gleixner <tglx@linutronix.de> wrote:

> On Wed, 25 Mar 2009, Pekka Enberg wrote:
> > On Wed, Mar 25, 2009 at 7:19 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
> > > This makes sense, since we now encourage developers to just call kfree
> > > without checking for NULL.
> > 
> > But those are _error handling paths_ (at least supposed to be). I
> > wonder which call-sites are responsible for this. Can frtrace help us
> > here?
> 

-mm's profile-likely-unlikely-macros.patch gives the backtraces you're
looking for.

I agree, probably some particular callsite is doing something silly and
is skewing all the instrumentation.

We have at times identified callsites where kfree(0) is so likely that
"remove the NULL test" was an undesirable change.

Many many many kfree() callsites _know_ that the pointer isn't NULL. 
Having that test in kfree() was always stupid.  What we should do is to
have a kfree_it_isnt_null() for those callsites so they can omit the test
altogether.



  parent reply	other threads:[~2009-03-25 21:28 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-25  5:19 [PATCH 0/5] [PATCH][GIT PULL] remove unnecessary (un)likelys Steven Rostedt
2009-03-25  5:19 ` [PATCH 1/5] ptrace: remove incorrect unlikelys Steven Rostedt
2009-03-25  7:21   ` Ingo Molnar
2009-03-25 13:31     ` Christian Borntraeger
2009-03-25 13:42     ` Steven Rostedt
2009-03-25  9:28   ` Roland McGrath
2009-03-25  5:19 ` [PATCH 2/5] mm: remove unlikly NULL from kfree Steven Rostedt
2009-03-25  7:34   ` Pekka Enberg
2009-03-25  7:50     ` Thomas Gleixner
2009-03-25  8:01       ` Pekka Enberg
2009-03-25 21:20       ` Andrew Morton [this message]
2009-03-25  8:02     ` Hua Zhong
2009-03-25  8:06       ` Pekka Enberg
2009-03-25 13:51         ` Pekka Enberg
2009-03-25 14:47           ` Steven Rostedt
2009-03-25 14:59             ` Pekka Enberg
2009-03-25 15:04               ` Steven Rostedt
2009-03-25 15:08                 ` Steven Rostedt
2009-03-25 16:14                   ` Matt Mackall
2009-03-25 16:34                     ` Steven Rostedt
2009-03-25 20:26                       ` Jeremy Fitzhardinge
2009-03-25 21:09                         ` Matt Mackall
2009-03-25 21:01                       ` Matt Mackall
2009-03-25 21:24                         ` Steven Rostedt
2009-03-25 15:27             ` Steven Rostedt
2009-03-26 16:10           ` Al Viro
2009-03-26 16:15             ` Andrew Morton
2009-03-25  5:19 ` [PATCH 3/5] sched: remove unlikely in pre_schedule_rt Steven Rostedt
2009-03-25  5:24   ` Steven Rostedt
2009-03-25  5:19 ` [PATCH 4/5] sched: remove unlikelys from sched_move_task Steven Rostedt
2009-03-25  5:19 ` [PATCH 5/5] mm: remove unlikelys for unlock in rmap.c Steven Rostedt
2009-04-24 11:12   ` KOSAKI Motohiro
2009-04-24 12:15     ` Lee Schermerhorn
2009-03-25  7:19 ` [PATCH 0/5] [PATCH][GIT PULL] remove unnecessary (un)likelys Ingo Molnar
2009-03-25  7:25 ` Ingo Molnar
2009-03-25 13:43   ` Steven Rostedt
2009-04-27 16:30 ` Daniel Walker

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=20090325142006.3ba0ee10.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cl@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mpm@selenic.com \
    --cc=nickpiggin@yahoo.com.au \
    --cc=penberg@cs.helsinki.fi \
    --cc=peterz@infradead.org \
    --cc=roland@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=srostedt@redhat.com \
    --cc=tglx@linutronix.de \
    /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