server-skynet-source-3rd-je.../include/jemalloc/internal
David Goldblatt 3f685e8824 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.
2017-05-19 14:21:27 -07:00
..
arena_externs.h Refactor *decay_time into *decay_ms. 2017-05-18 11:33:45 -07:00
arena_inlines_a.h Get rid of most of the various inline macros. 2017-04-24 10:33:21 -07:00
arena_inlines_b.h Header refactoring: size_classes module - remove from the catchall 2017-04-24 10:33:21 -07:00
arena_structs_a.h Header refactoring: bitmap - unify and remove from catchall. 2017-04-24 10:33:21 -07:00
arena_structs_b.h Refactor *decay_time into *decay_ms. 2017-05-18 11:33:45 -07:00
arena_types.h Refactor *decay_time into *decay_ms. 2017-05-18 11:33:45 -07:00
assert.h Disentangle assert and util 2017-03-06 15:08:43 -08:00
atomic_c11.h Introduce a backport of C11 atomics 2017-03-03 13:40:59 -08:00
atomic_gcc_atomic.h Insert not_reached after an exhaustive switch 2017-03-06 15:08:43 -08:00
atomic_gcc_sync.h Introduce a backport of C11 atomics 2017-03-03 13:40:59 -08:00
atomic_msvc.h Introduce a backport of C11 atomics 2017-03-03 13:40:59 -08:00
atomic.h Move CPP_PROLOGUE and CPP_EPILOGUE to the .cpp 2017-04-18 18:35:03 -07:00
base_externs.h Track extent structure serial number (esn) in extent_t. 2017-04-17 14:47:45 -07:00
base_inlines.h Get rid of most of the various inline macros. 2017-04-24 10:33:21 -07:00
base_structs.h Header refactoring: size_classes module - remove from the catchall 2017-04-24 10:33:21 -07:00
base_types.h Break up headers into constituent parts 2017-01-12 15:43:51 -08:00
bit_util.h Disentangle assert and util 2017-03-06 15:08:43 -08:00
bitmap.h Avoid compiler warnings on Windows. 2017-05-11 18:06:20 -07:00
ckh.h Header refactoring: tsd - cleanup and dependency breaking. 2017-05-01 10:49:56 -07:00
ctl.h Refactor *decay_time into *decay_ms. 2017-05-18 11:33:45 -07:00
extent_dss_externs.h Break up headers into constituent parts 2017-01-12 15:43:51 -08:00
extent_dss_structs.h Break up headers into constituent parts 2017-01-12 15:43:51 -08:00
extent_dss_types.h Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
extent_externs.h Protect the rtree/extent interactions with a mutex pool. 2017-05-19 14:21:27 -07:00
extent_inlines.h Protect the rtree/extent interactions with a mutex pool. 2017-05-19 14:21:27 -07:00
extent_mmap_externs.h Refactor !opt.munmap to opt.retain. 2017-04-29 09:24:12 -07:00
extent_structs.h Refactor !opt.munmap to opt.retain. 2017-04-29 09:24:12 -07:00
extent_types.h Disentangle arena and extent locking. 2017-02-01 16:43:46 -08:00
hash.h Header refactoring: hash - unify and remove from catchall. 2017-04-25 09:51:38 -07:00
hooks.h Add basic reentrancy-checking support, and allow arena_new to reenter. 2017-04-07 14:10:27 -07:00
jemalloc_internal_decls.h Refactor *decay_time into *decay_ms. 2017-05-18 11:33:45 -07:00
jemalloc_internal_defs.h.in Automatically generate private symbol name mangling macros. 2017-05-11 23:06:54 -07:00
jemalloc_internal_externs.h Header refactoring: tsd - cleanup and dependency breaking. 2017-05-01 10:49:56 -07:00
jemalloc_internal_includes.h Protect the rtree/extent interactions with a mutex pool. 2017-05-19 14:21:27 -07:00
jemalloc_internal_inlines_a.h Refactor (MALLOCX_ARENA_MAX + 1) to be MALLOCX_ARENA_LIMIT. 2017-05-14 10:14:23 -07:00
jemalloc_internal_inlines_b.h Get rid of most of the various inline macros. 2017-04-24 10:33:21 -07:00
jemalloc_internal_inlines_c.h Get rid of most of the various inline macros. 2017-04-24 10:33:21 -07:00
jemalloc_internal_macros.h Stop depending on JEMALLOC_N() for function interception during testing. 2017-05-11 23:06:54 -07:00
jemalloc_internal_types.h Refactor (MALLOCX_ARENA_MAX + 1) to be MALLOCX_ARENA_LIMIT. 2017-05-14 10:14:23 -07:00
jemalloc_preamble.h.in Automatically generate private symbol name mangling macros. 2017-05-11 23:06:54 -07:00
large_externs.h Stop depending on JEMALLOC_N() for function interception during testing. 2017-05-11 23:06:54 -07:00
malloc_io.h Move CPP_PROLOGUE and CPP_EPILOGUE to the .cpp 2017-04-18 18:35:03 -07:00
mutex_externs.h Allow mutexes to take a lock ordering enum at construction. 2017-05-19 14:21:27 -07:00
mutex_inlines.h Header refactoring: tsd - cleanup and dependency breaking. 2017-05-01 10:49:56 -07:00
mutex_pool_inlines.h Protect the rtree/extent interactions with a mutex pool. 2017-05-19 14:21:27 -07:00
mutex_pool_structs.h Protect the rtree/extent interactions with a mutex pool. 2017-05-19 14:21:27 -07:00
mutex_prof.h Remove mutex_prof_data_t redeclaration. 2017-05-11 10:49:43 -07:00
mutex_structs.h Protect the rtree/extent interactions with a mutex pool. 2017-05-19 14:21:27 -07:00
mutex_types.h Allow mutexes to take a lock ordering enum at construction. 2017-05-19 14:21:27 -07:00
nstime.h Stop depending on JEMALLOC_N() for function interception during testing. 2017-05-11 23:06:54 -07:00
pages.h Header refactoring: pages.h - unify and remove from catchall. 2017-04-25 09:51:38 -07:00
ph.h Add any() and remove_any() to ph. 2017-03-07 10:25:33 -08:00
private_namespace.sh Automatically generate private symbol name mangling macros. 2017-05-11 23:06:54 -07:00
private_symbols.sh Automatically generate private symbol name mangling macros. 2017-05-11 23:06:54 -07:00
prng.h Header refactoring: prng module - remove from the catchall and unify. 2017-04-24 10:33:21 -07:00
prof_externs.h Stop depending on JEMALLOC_N() for function interception during testing. 2017-05-11 23:06:54 -07:00
prof_inlines_a.h Get rid of most of the various inline macros. 2017-04-24 10:33:21 -07:00
prof_inlines_b.h Header refactoring: tsd - cleanup and dependency breaking. 2017-05-01 10:49:56 -07:00
prof_structs.h Header refactoring: ckh module - remove from the catchall and unify. 2017-04-24 10:33:21 -07:00
prof_types.h Convert arena->prof_accumbytes synchronization to atomics. 2017-02-16 09:39:46 -08:00
public_namespace.sh Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
public_unnamespace.sh Fix name mangling for stress tests. 2014-01-16 17:38:01 -08:00
ql.h Header refactoring: break out qr.h dependencies 2017-04-11 11:52:30 -07:00
qr.h Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
rb.h Header refactoring: break out rb.h dependencies 2017-04-11 11:52:30 -07:00
rtree_ctx.h Header refactoring: tsd - cleanup and dependency breaking. 2017-05-01 10:49:56 -07:00
rtree_externs.h Protect the rtree/extent interactions with a mutex pool. 2017-05-19 14:21:27 -07:00
rtree_inlines.h Protect the rtree/extent interactions with a mutex pool. 2017-05-19 14:21:27 -07:00
rtree_structs.h Protect the rtree/extent interactions with a mutex pool. 2017-05-19 14:21:27 -07:00
rtree_types.h Protect the rtree/extent interactions with a mutex pool. 2017-05-19 14:21:27 -07:00
size_classes.sh Remove --with-lg-tiny-min. 2017-04-24 11:48:28 -07:00
smoothstep.h Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
smoothstep.sh Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
spin.h Header refactoring: unify spin.h and move it out of the catch-all. 2017-04-18 18:35:03 -07:00
stats.h Add stats: arena uptime. 2017-05-18 10:04:28 -07:00
tcache_externs.h Revert "Use trylock in tcache_bin_flush when possible." 2017-05-01 14:49:42 -07:00
tcache_inlines.h Revert "Use trylock in tcache_bin_flush when possible." 2017-05-01 14:49:42 -07:00
tcache_structs.h Header refactoring: stats - unify and remove from catchall 2017-04-24 10:33:21 -07:00
tcache_types.h Header refactoring: size_classes module - remove from the catchall 2017-04-24 10:33:21 -07:00
ticker.h Header refactoring: tsd - cleanup and dependency breaking. 2017-05-01 10:49:56 -07:00
tsd_generic.h Header refactoring: tsd - cleanup and dependency breaking. 2017-05-01 10:49:56 -07:00
tsd_malloc_thread_cleanup.h Header refactoring: tsd - cleanup and dependency breaking. 2017-05-01 10:49:56 -07:00
tsd_tls.h Header refactoring: tsd - cleanup and dependency breaking. 2017-05-01 10:49:56 -07:00
tsd_types.h Header refactoring: tsd - cleanup and dependency breaking. 2017-05-01 10:49:56 -07:00
tsd_win.h Header refactoring: tsd - cleanup and dependency breaking. 2017-05-01 10:49:56 -07:00
tsd.h Protect the rtree/extent interactions with a mutex pool. 2017-05-19 14:21:27 -07:00
util.h Remove --disable-cc-silence. 2017-04-24 15:02:45 -07:00
witness_externs.h Stop depending on JEMALLOC_N() for function interception during testing. 2017-05-11 23:06:54 -07:00
witness_inlines.h Get rid of most of the various inline macros. 2017-04-24 10:33:21 -07:00
witness_structs.h Break up headers into constituent parts 2017-01-12 15:43:51 -08:00
witness_types.h Protect the rtree/extent interactions with a mutex pool. 2017-05-19 14:21:27 -07:00