lkml.org 
[lkml]   [2005]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] no need to check for NULL before calling kfree() -fs/ext2/

Hi Paul,

Sorry about the late reply.


On Sun, 27 Mar 2005, Paul Jackson wrote:

> Jesper wrote:
> > What I'm trying to find out now is if there's a general consensus that
> > these patches are worthwile and wanted or if they are unwanted and I'm
> > wasting my time.
>
> Thanks for your good work so far, and your good natured tolerance of
> the excessively detailed discussions resulting.
>
> I don't have a big preference either way - but a couple of questions:
>
> 1) Do you have any wild guess of how many of these you've done so far,
> and how many potentially remain that could be done? Tens, hundreds,
> thousands?
>
That would indeed be a wild guess, I guess I've done somewhere inbetween
50 and 200 so far, and I guess there's probably somewhere around 1-2000
left... but, I'm guessing.


> 2) Any idea what was going on with the numbers you posted yesterday,
> which, at least from what I saw at first glance, seemed to show
> "if (likely(p)) kfree(p);" to be a good or best choice, for all
> cases, including (p != NULL) being very unlikely? That seemed
> like a weird result.
>
> If the use of "likely(p)" is almost always a winner, then the changes
> you've been doing, followed by a header file change:
>
> static inline void kfree(const void *p)
> {
> if (likely(p))
> __kfree(p); /* __kfree(p) doesn't check for NULL p */
> }
>
> along the lines that Jan considered a few posts ago, might be a winner.
>
> But since this "likely(p)" result seems so bizarre, it seems unlikely that
> the above kfree wrapper would be a winner.
>
I don't think it matters much really. The way I read the numbers they seem
to indicate that the performance impact is very small in any case, and I'm
not even entirely sure my way of trying to measure is accurate, so I don't
know how much should be read into those numbers...


--
Jesper


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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