Re: [PATCH] no need to check for NULL before calling kfree() -fs/ext2/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

 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 won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <[email protected]> 1.650.933.1373, 1.925.600.0401
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux