All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Walker <dwalker@mvista.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Andrew Morton <akpm@osdl.org>,
	Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>,
	Jens Axboe <axboe@kernel.dk>,
	Christoph Lameter <clameter@sgi.com>,
	Pedro Roque <roque@di.fc.ul.pt>,
	"David S. Miller" <davem@davemloft.net>,
	"Paul E. McKenney" <paulmck@us.ibm.com>,
	Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Allow NULL pointers in percpu_free
Date: Fri, 17 Nov 2006 10:14:07 -0800	[thread overview]
Message-ID: <1163787247.3097.14.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0611171307180.2627-100000@iolanthe.rowland.org>

On Fri, 2006-11-17 at 13:07 -0500, Alan Stern wrote:
> On Fri, 17 Nov 2006, Daniel Walker wrote:
> 
> > On Fri, 2006-11-17 at 12:36 -0500, Alan Stern wrote:
> > 
> > >  void percpu_free(void *__pdata)
> > >  {
> > > +	if (!__pdata)
> > > +		return;
> > 
> > Should be unlikely() right?
> 
> It certainly could be.  I tend not to put such annotations in my code, but 
> it wouldn't hurt.

It's actually a really good idea to add them .. I've noticed they tend
to make my kernels smaller, although I wouldn't expect that to always be
the case.. Another reason is that in -mm we can track how often this
condition is triggered with likely profiling. With kfree, for instance,
there were a number of callers that frequently called kfree(NULL), which
IMO isn't good.

Daniel


  reply	other threads:[~2006-11-17 18:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-17 17:36 [PATCH] Allow NULL pointers in percpu_free Alan Stern
2006-11-17 17:47 ` Daniel Walker
2006-11-17 18:07   ` Alan Stern
2006-11-17 18:14     ` Daniel Walker [this message]
2006-11-17 19:35       ` Alan Stern

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=1163787247.3097.14.camel@localhost.localdomain \
    --to=dwalker@mvista.com \
    --cc=akpm@osdl.org \
    --cc=axboe@kernel.dk \
    --cc=clameter@sgi.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@us.ibm.com \
    --cc=roque@di.fc.ul.pt \
    --cc=stern@rowland.harvard.edu \
    --cc=venkatesh.pallipadi@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.