Re: A quick view of the performance benchmark for semaphore-likeand mutex

From: Peter Zijlstra
Date: Tue Apr 17 2012 - 06:10:02 EST


On Tue, 2012-04-17 at 09:36 +0000, Chen, Dennis (SRDC SW) wrote:
> Just as a quick & rough test, with below changes based on mutex (almost the same as semaphore):
>
> --- /home/dennis/Linux/linux-3.3.2-sem/kernel/mutex.c 2012-04-17 14:59:49.823177615 +0800
> +++ ./mutex.c 2012-04-17 17:00:12.963059284 +0800
> @@ -140,6 +140,7 @@ __mutex_lock_common(struct mutex *lock,
> preempt_disable();
> mutex_acquire_nest(&lock->dep_map, subclass, 0, nest_lock, ip);
>
> +#if 0
> #ifdef CONFIG_MUTEX_SPIN_ON_OWNER
> /*
> * Optimistic spinning.
> @@ -195,6 +196,7 @@ __mutex_lock_common(struct mutex *lock,
> arch_mutex_cpu_relax();
> }
> #endif
> +#endif
> spin_lock_mutex(&lock->wait_lock, flags);
>
> debug_mutex_lock_common(lock, &waiter);


or you do:

echo NO_OWNER_SPIN > /debug/sched_features


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/