Re: [PATCH 09/10] percpu: implement new dynamic percpu allocator

From: Rusty Russell
Date: Mon Feb 23 2009 - 21:53:03 EST


On Friday 20 February 2009 13:34:17 Andrew Morton wrote:
> It's a dumb convention.

I disagree, but it doesn't matter. Least surprise wins; let's not make
kernel coding any harder than it has to be.

free() does it, so kfree() should do it. Otherwise call it something
completely different. Too late, let's move on...

> In the vast majority of cases the pointer is
> not NULL. We add a test-n-branch to 99.999999999% of cases just to
> save three seconds of programmer effort a single time.

It's unusual, but since I've used it several times in the kernel myself,
it's less than 4 9s (by call sites not by usage, since it tends to be
error paths).

> (We can still do that by adding a new
> kfree_im_not_stupid() which doesn't do the check).

Now you're insulting people who use it as well as exaggerating your case.

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