On Tue, Feb 11, 2014 at 04:30:48PM -0800, Jarno Rajahalme wrote:
> ovs_mutex showed high up in 'perf' stats, use a spinlock instead.
>
> Signed-off-by: Jarno Rajahalme <[email protected]>
Do spinlocks perform better than adaptive mutexes, e.g. that one would
initialize by adding a function like this:
/* Initializes 'mutex' as an adaptive mutex. */
void
ovs_mutex_init_adaptive(const struct ovs_mutex *mutex)
{
#ifndef PTHREAD_MUTEX_ADAPTIVE_NP
#define PTHREAD_MUTEX_ADAPTIVE_NP PTHREAD_MUTEX_NORMAL
#endif
ovs_mutex_init__(mutex, PTHREAD_MUTEX_ADAPTIVE_NP);
}
(spinlocks are nasty when a thread gets descheduled.)
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev