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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]