Go to file
Dave Watson b23336af96 mutex: fix trylock spin wait contention
If there are 3 or more threads spin-waiting on the same mutex,
there will be excessive exclusive cacheline contention because
pthread_trylock() immediately tries to CAS in a new value, instead
of first checking if the lock is locked.

This diff adds a 'locked' hint flag, and we will only spin wait
without trylock()ing while set.  I don't know of any other portable
way to get the same behavior as pthread_mutex_lock().

This is pretty easy to test via ttest, e.g.

./ttest1 500 3 10000 1 100

Throughput is nearly 3x as fast.

This blames to the mutex profiling changes, however, we almost never
have 3 or more threads contending in properly configured production
workloads, but still worth fixing.
2018-11-28 15:17:02 -08:00
bin Filter out "void *newImpl" in prof output. 2017-08-08 12:28:29 -07:00
build-aux Update config.{guess,sub} from upstream. 2016-11-10 15:08:32 -08:00
doc Add stats for the size of extent_avail heap 2018-08-02 10:16:06 -07:00
include mutex: fix trylock spin wait contention 2018-11-28 15:17:02 -08:00
m4 jemalloc cpp new/delete bindings 2016-12-12 18:36:06 -08:00
msvc Add sc.c to the MSVC project 2018-09-04 12:58:05 -07:00
scripts Test smallocx on Travis-CI 2018-10-17 07:12:28 -07:00
src mutex: fix trylock spin wait contention 2018-11-28 15:17:02 -08:00
test Deprecate OSSpinLock. 2018-11-14 08:44:05 -08:00
.appveyor.yml Revert "CI: Remove "catgets" dependency on appveyor." 2018-03-15 13:58:42 -07:00
.autom4te.cfg Disable autom4te cache. 2014-09-02 17:49:29 -07:00
.gitattributes fix git handling of newlines on windows 2014-05-07 18:48:39 -04:00
.gitignore Kill size_classes.sh. 2018-07-12 20:53:06 -07:00
.travis.yml Test smallocx on Travis-CI 2018-10-17 07:12:28 -07:00
autogen.sh Move repo contents in jemalloc/ to top level. 2011-03-31 20:36:17 -07:00
ChangeLog Update ChangeLog for 5.1.0. 2018-05-08 12:06:34 -07:00
config.stamp.in Move repo contents in jemalloc/ to top level. 2011-03-31 20:36:17 -07:00
configure.ac Deprecate OSSpinLock. 2018-11-14 08:44:05 -08:00
COPYING Update copyright dates. 2018-05-03 15:31:42 -07:00
INSTALL.md Remove the --with-lg-page-sizes configure option. 2018-07-12 20:53:06 -07:00
jemalloc.pc.in Reformat the version number in jemalloc.pc.in. 2018-05-07 20:12:03 -07:00
Makefile.in add test for zero-sized alloc and aligned alloc 2018-10-17 08:50:58 -07:00
README Update project URL. 2016-09-12 11:56:24 -07:00
run_tests.sh Introduce scripts to run all possible tests 2017-01-30 17:51:57 -08:00
TUNING.md Add TUNING.md. 2018-05-03 12:52:52 -07:00

jemalloc is a general purpose malloc(3) implementation that emphasizes
fragmentation avoidance and scalable concurrency support.  jemalloc first came
into use as the FreeBSD libc allocator in 2005, and since then it has found its
way into numerous applications that rely on its predictable behavior.  In 2010
jemalloc development efforts broadened to include developer support features
such as heap profiling and extensive monitoring/tuning hooks.  Modern jemalloc
releases continue to be integrated back into FreeBSD, and therefore versatility
remains critical.  Ongoing development efforts trend toward making jemalloc
among the best allocators for a broad range of demanding applications, and
eliminating/mitigating weaknesses that have practical repercussions for real
world applications.

The COPYING file contains copyright and licensing information.

The INSTALL file contains information on how to configure, build, and install
jemalloc.

The ChangeLog file contains a brief summary of changes for each release.

URL: http://jemalloc.net/