lkml.org 
[lkml]   [2005]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [patch 05/15] Generic Mutex Subsystem, mutex-core.patch
    From
    Date
    On Mon, 2005-12-19 at 02:37 +0100, Ingo Molnar wrote:
    > +static inline void __mutex_unlock_nonatomic(struct mutex *lock
    > __IP_DECL__)
    > +{
    > + struct thread_info *ti = current_thread_info();
    > + unsigned long flags;
    > +
    > + debug_lock_irqsave(&debug_lock, flags, ti);
    > + spin_lock(&lock->wait_lock);
    > +
    > +#ifdef CONFIG_DEBUG_MUTEXESS
    > + DEBUG_WARN_ON(lock->magic != lock);
    > + DEBUG_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next);
    > + DEBUG_WARN_ON(lock->owner != ti);
    > + if (debug_on) {
    > + DEBUG_WARN_ON(list_empty(&lock->held_list));
    > + list_del_init(&lock->held_list);
    > + }
    > +#endif
    > +

    The unlikely below is only for the non MUTEX_LOCKLESS_FASTPATH case.
    Maybe have a define for the unlikely?

    #ifdef MUTEX_LOCKLESS_FASTPATH
    # define UNLIKELY_SLOW(x) x
    #else
    # define UNLIKELY_SLOW(x) unlikely(x)
    #endif

    -- Steve


    > + if (unlikely(!list_empty(&lock->wait_list)))
    > + __mutex_wakeup_waiter(lock __IP__);
    > +#ifdef CONFIG_DEBUG_MUTEXESS
    > + lock->owner = NULL;
    > +#endif

    -
    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-19 06:16    [W:0.021 / U:31.172 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site