From: Steven Rostedt <rostedt@goodmis.org>
To: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Greg KH <gregkh@suse.de>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] staging: remove null checks before kfree
Date: Thu, 24 Feb 2011 14:25:06 -0500 [thread overview]
Message-ID: <1298575506.6376.4.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <AANLkTinBFFU5c_kcXGSnJA-ycY6j7EeKvwAFb59iWMHn@mail.gmail.com>
On Thu, 2011-02-24 at 19:08 +0000, Ilia Mirkin wrote:
> FWIW my reasoning for doing this was that generally the reason you're
> freeing something is because you allocated it, so kfree(NULL) happens
> rarely -- error paths, conditional features, etc. If you actually
> expect the argument to be NULL often, then you would do something like
> if (unlikely(x)) kfree(x). This is done a few times in the core
> kernel. I think it makes more sense for kfree to keep the unlikely
> since in cold paths it won't matter and in hot paths where it is often
> NULL, there should be a conditional at the call site. [I'm sure you'll
> note the lack of an attached benchmark... this is just what makes
> sense to me.]
That unlikely has been there for years, and another year wont hurt
anything ;)
I'll run my unlikely clean up again in December, and we'll see what
needs to be touched then.
Thanks,
-- Steve
prev parent reply other threads:[~2011-02-24 19:25 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-22 8:53 Ilia Mirkin
2011-02-22 8:53 ` [PATCH 2/2] staging: remove null checks before kree(x); x = NULL; Ilia Mirkin
2011-02-22 14:54 ` [PATCH 1/2] staging: remove null checks before kfree Greg KH
2011-03-13 5:28 ` [PATCH 00/24] Remove NULL check " Ilia Mirkin
2011-03-13 5:28 ` [PATCH 01/24] staging: ath6kl: " Ilia Mirkin
2011-03-13 5:28 ` [PATCH 02/24] staging: bcm: " Ilia Mirkin
2011-03-13 5:28 ` [PATCH 03/24] staging: brcm80211: " Ilia Mirkin
2011-03-13 5:28 ` [PATCH 04/24] staging: comedi: " Ilia Mirkin
2011-03-13 5:28 ` [PATCH 05/24] staging: cx25821: " Ilia Mirkin
2011-03-13 5:28 ` [PATCH 06/24] staging: go7007: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 07/24] staging: hv: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 08/24] staging: keucr: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 09/24] staging: line6: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 10/24] staging: pohmelfs: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 11/24] staging: rt2860: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 12/24] staging: rtl8187se: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 13/24] staging: rtl8192e: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 14/24] staging: rtl8192u: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 15/24] staging: rtl8712: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 16/24] staging: serqt_usb2: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 17/24] staging: speakup: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 18/24] staging: tidspbridge: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 19/24] staging: usbip: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 20/24] staging: vme: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 21/24] staging: vt6655: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 22/24] staging: vt6656: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 23/24] staging: winbond: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 24/24] staging: wlan-ng: " Ilia Mirkin
2011-03-14 19:00 ` [PATCH 07/24] staging: hv: " Greg KH
2011-03-14 17:47 ` [PATCH 01/24] staging: ath6kl: " Luis R. Rodriguez
2011-02-24 16:08 ` [PATCH 1/2] staging: remove null checks " Steven Rostedt
2011-02-24 17:06 ` Greg KH
2011-02-24 17:25 ` Steven Rostedt
2011-02-24 19:08 ` Ilia Mirkin
2011-02-24 19:25 ` Steven Rostedt [this message]
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=1298575506.6376.4.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=imirkin@alum.mit.edu \
--cc=linux-kernel@vger.kernel.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®