[lkml]   [2004]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [RFC] Refcounting of objects part of a lockfree collection
    On Wed, Jul 14, 2004 at 02:27:58PM +0530, Ravikiran G Thirumalai wrote:
    > On Wed, Jul 14, 2004 at 12:07:00AM -0700, Greg KH wrote:
    > > On Wed, Jul 14, 2004 at 10:23:50AM +0530, Ravikiran G Thirumalai wrote:
    > > >
    > > > The attatched patch provides infrastructure for refcounting of objects
    > > > in a rcu protected collection.
    > >
    > > This is really close to the kref implementation. Why not just use that
    > > instead?
    > Close, but not the same. I just had a quick look at krefs.
    > Actually, this refrerence count infrastructure I am proposing is not for
    > traditional refcounting.

    But you are advertising it as such by calling it a refcount_t and
    putting it in a file called refcount.h.

    > > Oh, and I think you need to use atomic_set() instead of initializing the
    > > atomic_t by hand.
    > I have used atomic_set for the case where arch has cmpxchg. But for
    > arches lacking cmpxchg, I need to use hashed spinlocks to implement
    > the ref_count_get_rcu.
    > No point in having more atomic operations when I hold spinlocks. Admittedly,
    > might be a bit yucky to assume atomic_t internals, but it is just one header
    > file :) <ducks>

    I still think you need to fix this, manipulating atomic_t variables by
    hand is not always guaranteed to work on all arches, from what I

    And what arches do not support cmpxchg? How does this change affect the
    performance of them?


    greg k-h
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 14:04    [W:0.021 / U:10.276 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site