Messages in this thread Patch in this message | | | Subject | Re: A quick view of the performance benchmark for semaphore-like and mutex | From | Peter Zijlstra <> | Date | Tue, 17 Apr 2012 12:09:43 +0200 |
| |
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
| |