lkml.org 
[lkml]   [2005]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [patch 1/3] mutex subsystem: trylock

    * Arjan van de Ven <arjan@infradead.org> wrote:

    > > + * 1) if the exclusive store fails we fail, and
    > > + *
    > > + * 2) if the decremented value is not zero we don't even attempt the store.
    >
    >
    > btw I really think that 1) is wrong. trylock should do everything it
    > can to get the semaphore short of sleeping. Just because some
    > cacheline got written to (which might even be shared!) in the middle
    > of the atomic op is not a good enough reason to fail the trylock imho.
    > Going into the slowpath.. fine. But here it's a quality of
    > implementation issue; you COULD get the semaphore without sleeping (at
    > least probably, you'd have to retry to know for sure) but because
    > something wrote to the same cacheline as the lock... no. that's just
    > not good enough.. sorry.

    point. I solved this in my tree by calling the generic trylock <fn> if
    there's an __ex_flag failure in the ARMv6 case. Should be rare (and thus
    the call is under unlikely()), and should thus still enable the fast
    implementation.

    Ingo
    -
    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: 2005-12-27 14:20    [W:3.929 / U:0.328 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site