aboutsummaryrefslogtreecommitdiffstats
path: root/include/jemalloc/internal/tsd.h
diff options
context:
space:
mode:
authorDavid Goldblatt <davidgoldblatt@fb.com>2017-05-15 14:23:51 -0700
committerDavid Goldblatt <davidtgoldblatt@gmail.com>2017-05-19 14:21:27 -0700
commit3f685e88245c9807d7bdcaffce47b0fe14b974be (patch)
tree85e858b0c50aac09621766e7e08d98e406f7cb1a /include/jemalloc/internal/tsd.h
parent26c792e61a163b38b373023bca2947283dcd1fc8 (diff)
downloadplatform_external_jemalloc_new-3f685e88245c9807d7bdcaffce47b0fe14b974be.tar.gz
platform_external_jemalloc_new-3f685e88245c9807d7bdcaffce47b0fe14b974be.tar.bz2
platform_external_jemalloc_new-3f685e88245c9807d7bdcaffce47b0fe14b974be.zip
Protect the rtree/extent interactions with a mutex pool.
Instead of embedding a lock bit in rtree leaf elements, we associate extents with a small set of mutexes. This gets us two things: - We can use the system mutexes. This (hypothetically) protects us from priority inversion, and lets us stop doing a backoff/sleep loop, instead opting for precise wakeups from the mutex. - Cuts down on the number of mutex acquisitions we have to do (from 4 in the worst case to two). We end up simplifying most of the rtree code (which no longer has to deal with locking or concurrency at all), at the cost of additional complexity in the extent code: since the mutex protecting the rtree leaf elements is determined by reading the extent out of those elements, the initial read is racy, so that we may acquire an out of date mutex. We re-check the extent in the leaf after acquiring the mutex to protect us from this race.
Diffstat (limited to 'include/jemalloc/internal/tsd.h')
-rw-r--r--include/jemalloc/internal/tsd.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/include/jemalloc/internal/tsd.h b/include/jemalloc/internal/tsd.h
index 3d6576b4..1a269755 100644
--- a/include/jemalloc/internal/tsd.h
+++ b/include/jemalloc/internal/tsd.h
@@ -7,7 +7,6 @@
#include "jemalloc/internal/prof_types.h"
#include "jemalloc/internal/ql.h"
#include "jemalloc/internal/rtree_ctx.h"
-#include "jemalloc/internal/rtree_witness.h"
#include "jemalloc/internal/tcache_types.h"
#include "jemalloc/internal/tcache_structs.h"
#include "jemalloc/internal/util.h"
@@ -76,7 +75,6 @@ typedef void (*test_callback_t)(int *);
O(arenas_tdata, arena_tdata_t *) \
O(tcache, tcache_t) \
O(witnesses, witness_list_t) \
- O(rtree_leaf_elm_witnesses, rtree_leaf_elm_witness_tsd_t) \
O(witness_fork, bool) \
MALLOC_TEST_TSD
@@ -95,7 +93,6 @@ typedef void (*test_callback_t)(int *);
NULL, \
TCACHE_ZERO_INITIALIZER, \
ql_head_initializer(witnesses), \
- RTREE_ELM_WITNESS_TSD_INITIALIZER, \
false \
MALLOC_TEST_TSD_INITIALIZER \
}