Skip to contentSkip to conversation

kref, a tiny, sane, reference count object

RFC Andi Kleen 2 participants 2 messages Mar 13, 2004 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#1 lore raw
Quoted 1 line · Greg KH

Comments are appreciated and welcomed.

I really don't see the advantage of this. Writing the same using atomic_inc/ atomic_dec_and_test() implicitely is basically as clean, and you will save the overhead of carrying a release() pointer around. And the "patterns" for that are easy enough that I doubt people will get it wrong.

-Andi

#2 lore raw
Quoted 9 lines · Andi Kleen
Quoted 1 line · Greg KH

Comments are appreciated and welcomed.

I really don't see the advantage of this. Writing the same using atomic_inc/ atomic_dec_and_test() implicitely is basically as clean, and you will save the overhead of carrying a release() pointer around. And the "patterns" for that are easy enough that I doubt people will get it wrong.

But people do get it wrong (I've seen it happen). Using this keeps you from having to write your own get, and put functions. Multiply that by every usb driver that wants to (and needs to) use this kind of logic, and you have a lot of duplicated code that is unnecessary.

So we write it once, get it correct, and let everyone use it. Isn't that what the code in /lib is for? :)

thanks,

greg k-h