mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesper Juhl <juhl-lkml@dif.dk>
To: Jesper Juhl <juhl-lkml@dif.dk>
Cc: Paul Jackson <pj@engr.sgi.com>,
	Pekka J Enberg <penberg@cs.helsinki.fi>,
	jengelh@linux01.gwdg.de, penberg@gmail.com, rlrevell@joe-job.com,
	davej@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: no need to check for NULL before calling kfree() -fs/ext2/
Date: Sat, 9 Apr 2005 04:21:18 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.62.0504090417390.2455@dragon.hyggekrogen.localhost> (raw)
In-Reply-To: <Pine.LNX.4.62.0503302105320.2463@dragon.hyggekrogen.localhost>

On Wed, 30 Mar 2005, Jesper Juhl wrote:

> On Tue, 29 Mar 2005, Paul Jackson wrote:
> 
> > Pekka wrote:
> > >  (4) The cleanups Jesper and others are doing are to remove the
> > >      _redundant_ NULL checks (i.e. it is now checked twice). 
> > 
> > Even such obvious changes as removing redundant checks doesn't
> > seem to ensure a performance improvement.  Jesper Juhl posted
> > performance data for such changes in his microbenchmark a couple
> > of days ago.
> > 
> > As I posted then, I could swear that his numbers show:
> > 
> > > Just looking at the third run, it seems to me that "if (likely(p))
> > > kfree(p);" beats a naked "kfree(p);" everytime, whether p is half
> > > NULL's, or very few NULL's, or almost all NULL's.
> > 
> > Twice now I have asked Jesper to explain this strange result.
> > 
> I've been kept busy with other things for a while and haven't had the time 
> to reply to your emails, sorry.   As I just said in another post I don't 
> know how valid my numbers are, but I'll try and craft a few more tests to 
> see if I can get some more solid results.
> 
> > 
> > Maybe we should be following your good advice:
> > 
> > > You don't know that until you profile! 
> > 
> > instead of continuing to make these code changes.
> > 
> I'll gather some more numbers and post them along with any conclusions I 
> believe can be drawn from them within a day or two, untill then I'll hold 
> back on the patches...
> 
Ok, I never got around to doing some more benchmarks, mainly since it 
seems that people converged on the oppinion that the kfree() cleanups are 
OK and we can fix up any regressions by inlining kfree if needed (the 
difference these changes make to performance seem to be small and in the 
noice anyway).
If anyone would /like/ me to do more benchmarks, then speak up and I will 
do them - I guess I could also build a kernel with an inline kfree() as a 
comparison.. but, unless someone speaks up I'll just carry on making these 
kfree() cleanups and not bother with benchmarks...


-- 
Jesper



  reply	other threads:[~2005-04-09  2:18 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-25 22:08 [PATCH] no need to check for NULL before calling kfree() - fs/ext2/ Jesper Juhl
2005-03-25 22:29 ` linux-os
2005-03-25 22:44   ` Jesper Juhl
2005-03-26  7:50   ` Pekka Enberg
2005-03-26  8:32   ` Arjan van de Ven
2005-03-26 23:21     ` [PATCH] no need to check for NULL before calling kfree() -fs/ext2/ linux-os
2005-03-26 23:34       ` Marcin Dalecki
2005-03-27  2:00         ` Horst von Brand
2005-03-27  3:18           ` Marcin Dalecki
2005-03-27 22:12         ` linux-os
2005-03-26 23:54       ` Jesper Juhl
2005-03-27  0:05         ` Lee Revell
2005-03-27 10:55           ` Jesper Juhl
2005-03-27 14:56             ` Paul Jackson
2005-03-27 15:12               ` Jan Engelhardt
2005-03-27 17:40                 ` Dave Jones
2005-03-27 18:17                   ` Jan Engelhardt
2005-03-27 19:25                   ` Pekka Enberg
2005-03-27 22:56                   ` Jesper Juhl
2005-03-28  4:53                     ` Paul Jackson
2005-03-30 18:57                       ` Jesper Juhl
2005-03-28  1:20                   ` Horst von Brand
2005-03-28  4:10                   ` Paul Jackson
2005-03-28 12:58                   ` Geert Uytterhoeven
2005-03-29  2:52                   ` Lee Revell
2005-03-29  6:30                     ` Pekka Enberg
2005-03-29  7:06                       ` Jan Engelhardt
2005-03-29  7:24                         ` Pekka J Enberg
2005-03-30  2:44                           ` Paul Jackson
2005-03-30  6:13                             ` Pekka J Enberg
2005-03-30  6:16                               ` Paul Jackson
2005-03-30  7:15                               ` P Lavin
2005-03-30 14:20                                 ` Jesper Juhl
2005-03-30 19:10                             ` Jesper Juhl
2005-04-09  2:21                               ` Jesper Juhl [this message]
2005-03-28  4:07                 ` [PATCH] " Paul Jackson
2005-03-27  8:45       ` Arjan van de Ven
2005-03-27 12:51         ` Denis Vlasenko
2005-03-27 14:28           ` Arjan van de Ven
2005-03-27 23:13         ` [PATCH] no need to check for NULL before calling kfree()-fs/ext2/ linux-os
2005-03-31  6:30 no need to check for NULL before calling kfree() -fs/ext2/ P Lavin

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=Pine.LNX.4.62.0504090417390.2455@dragon.hyggekrogen.localhost \
    --to=juhl-lkml@dif.dk \
    --cc=davej@redhat.com \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=penberg@gmail.com \
    --cc=pj@engr.sgi.com \
    --cc=rlrevell@joe-job.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

all inboxes | Powered by JetHome®