Re: [PATCH] [keys] Always use key_get() to increment key refcount

From: David Howells
Date: Wed Mar 19 2008 - 19:55:50 EST


Arun Raghavan <arunsr@xxxxxxxxxxxxxx> wrote:

> Patch to use key_get() wherever the keys code manually increments the
> key refcount.
>
> This should make debugging a little simpler for clients, since it
> becomes easier to track where a key's refcount changes.

The problem with this is that key_get() is not simply an atomic_inc(). You
end up introducing an extra conditional into each of these places where one is
not required. Now it's possible that the compiler's optimiser is sufficiently
clever to get rid of them all, but do you guarantee that?

David
--
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/