lkml.org 
[lkml]   [2006]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 3/3] use kref for bio
On Wed, Apr 26, 2006 at 03:20:30PM +0800, Akinobu Mita wrote:
> If this is good one and the places where Al Viro pointed out really affect
> performance, should we propagate this faster one by introducing helper
> function like:
>
> static inline int refcount_test(atomic_t *refcount)
> {
> return (atomic_read(refcount) == 1) || (atomic_dec_and_test(refcount));
> }
>
> and replace atomic_dec_and_test with it?

No. It's obviously slower than atomic_dec_and_test() if refcount is
greater than 1. And I'm less than sure that you can show that benefits
in case when it is 1 outweight that. Moreover, for dentries, inodes,
superblocks and vfsmounts you'd have to pull spin_lock() in front of
it, which would _definitely_ hurt (these are atomic_dec_and_lock()).
-
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: 2006-04-26 09:45    [W:0.066 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site