[lkml]   [2005]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: no need to check for NULL before calling kfree() -fs/ext2/
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...

Jesper Juhl

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-04-06 13:31    [W:0.088 / U:4.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site