lkml.org 
[lkml]   [2006]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH] Keys: Improve usage of memory barriers and remove IRQ disablement
    From
    From: Nick Piggin <nickpiggin@yahoo.com.au>
    Date: Wed, 05 Apr 2006 19:23:58 +1000

    > David Howells wrote:
    > > Nick Piggin <nickpiggin@yahoo.com.au> wrote:
    >
    > > | int atomic_inc_and_test(atomic_t *v);
    > > | int atomic_dec_and_test(atomic_t *v);
    > > |
    > > | These two routines increment and decrement by 1, respectively, the
    > > | given atomic counter. They return a boolean indicating whether the
    > > | resulting counter value was zero or not.
    > > |
    > > | It requires explicit memory barrier semantics around the operation as
    > > | above.
    > >
    > > Note the last paragraph. "It requires" should be "They require", but the
    > > sense would seem to be obvious. However, it's not clear on a second reading
    > > as to whether this is an instruction to the _caller_ or an instruction to the
    > > arch _implementer_.
    > >
    >
    > Yes, I remember Dave M clarified this sometime ago (on lkml I guess). It
    > is a little confusing, but I think the wording is for the implementer's
    > point of view. Dave will pull me up if I'm wrong...

    Any routine which returns state must have the barriers in the arch
    implementation. These two routines returns state.
    -
    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-06 00:58    [W:0.031 / U:0.020 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site