lkml.org 
[lkml]   [2008]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [keys] Always use key_get() to increment key refcount
On Wed, 19 Mar 2008, David Howells wrote:

> Arun Raghavan <arunsr@cse.iitk.ac.in> 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?

Is this really a significant performance penalty? If yes, wouldn't a
likely() be sufficient to mitigate the penalty?

The same arguments should also be applied to key_put(), I guess.

Regards,
Arun


\
 
 \ /
  Last update: 2008-03-20 12:51    [W:2.006 / U:2.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site