]> git.openfabrics.org - ~shefty/librdmacm.git/commit
rsockets: Optimize synchronization to improve performance
authorSean Hefty <sean.hefty@intel.com>
Tue, 8 May 2012 00:16:47 +0000 (17:16 -0700)
committerSean Hefty <sean.hefty@intel.com>
Tue, 8 May 2012 00:16:47 +0000 (17:16 -0700)
commitbbc2e73cd81751d0504bba3e508a14972adce8be
treed4bd62f68b19a3992515a80d129cc327a1c971d8
parent5658ff385e0449a78a325d430163e524b7a97ec4
rsockets: Optimize synchronization to improve performance

Performance analysis using VTune showed that pthread_mutex_unlock()
is the single biggest contributor to increasing latency for 64-byte
transfers.  Unlocked was followed by get_sw_cqe(), then
__pthread_mutex_lock().  Replace the use of mutexes with an atomic
and a semaphore.  When there's no contention for the lock (which
would usually be the case when using nonblocking sockets), the
code simply increments and decrements an atomic varible.  Semaphores
are only used when contention occurs.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/cma.h
src/rsocket.c