diff options
author | Jason Evans <jasone@canonware.com> | 2017-01-29 21:32:39 -0800 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2017-03-01 15:00:00 -0800 |
commit | f674f43893d6282bf6e728c510b901a10b38bc48 (patch) | |
tree | fb91282ae222ce247d3e8351228da5cd681bc8c1 /include | |
parent | 5a22dd0d39b5f0d1d3f8fe9b27cce100753d24f3 (diff) | |
download | jemalloc-f674f43893d6282bf6e728c510b901a10b38bc48.tar.gz |
Fix/refactor tcaches synchronization.android-n-mr2-preview-2
Synchronize tcaches with tcaches_mtx rather than ctl_mtx. Add missing
synchronization for tcache flushing. This bug was introduced by
1cb181ed632e7573fb4eab194e4d216867222d27 (Implement explicit tcache
support.), which was first released in 4.0.0.
(cherry picked from commit 3ecc3c84862ef3e66b20be8213b0301c06c692cc)
Bug: 35867477
Test: Booted angler using normal config and svelte config.
Test: Ran bionic unit tests/jemalloc tests.
Test: Ran the art ThreadStress tests on the normal config/svelte config.
Change-Id: I8de25e7eae8f0b055febafee1b5e4d170371bbcd
Diffstat (limited to 'include')
-rw-r--r-- | include/jemalloc/internal/private_symbols.txt | 3 | ||||
-rw-r--r-- | include/jemalloc/internal/tcache.h | 3 | ||||
-rw-r--r-- | include/jemalloc/internal/witness.h | 21 |
3 files changed, 17 insertions, 10 deletions
diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt index c1c6c40..14c8fe2 100644 --- a/include/jemalloc/internal/private_symbols.txt +++ b/include/jemalloc/internal/private_symbols.txt @@ -529,6 +529,9 @@ tcache_flush tcache_get tcache_get_hard tcache_maxclass +tcache_prefork +tcache_postfork_child +tcache_postfork_parent tcache_salloc tcache_stats_merge tcaches diff --git a/include/jemalloc/internal/tcache.h b/include/jemalloc/internal/tcache.h index 4d0a8ff..da4f54f 100644 --- a/include/jemalloc/internal/tcache.h +++ b/include/jemalloc/internal/tcache.h @@ -161,6 +161,9 @@ bool tcaches_create(tsd_t *tsd, unsigned *r_ind); void tcaches_flush(tsd_t *tsd, unsigned ind); void tcaches_destroy(tsd_t *tsd, unsigned ind); bool tcache_boot(tsdn_t *tsdn); +void tcache_prefork(tsdn_t *tsdn); +void tcache_postfork_parent(tsdn_t *tsdn); +void tcache_postfork_child(tsdn_t *tsdn); #endif /* JEMALLOC_H_EXTERNS */ /******************************************************************************/ diff --git a/include/jemalloc/internal/witness.h b/include/jemalloc/internal/witness.h index cdf15d7..63bc22a 100644 --- a/include/jemalloc/internal/witness.h +++ b/include/jemalloc/internal/witness.h @@ -14,19 +14,20 @@ typedef int witness_comp_t (const witness_t *, const witness_t *); #define WITNESS_RANK_INIT 1U #define WITNESS_RANK_CTL 1U -#define WITNESS_RANK_ARENAS 2U +#define WITNESS_RANK_TCACHES 2U +#define WITNESS_RANK_ARENAS 3U -#define WITNESS_RANK_PROF_DUMP 3U -#define WITNESS_RANK_PROF_BT2GCTX 4U -#define WITNESS_RANK_PROF_TDATAS 5U -#define WITNESS_RANK_PROF_TDATA 6U -#define WITNESS_RANK_PROF_GCTX 7U +#define WITNESS_RANK_PROF_DUMP 4U +#define WITNESS_RANK_PROF_BT2GCTX 5U +#define WITNESS_RANK_PROF_TDATAS 6U +#define WITNESS_RANK_PROF_TDATA 7U +#define WITNESS_RANK_PROF_GCTX 8U -#define WITNESS_RANK_ARENA 8U -#define WITNESS_RANK_ARENA_CHUNKS 9U -#define WITNESS_RANK_ARENA_NODE_CACHE 10 +#define WITNESS_RANK_ARENA 9U +#define WITNESS_RANK_ARENA_CHUNKS 10U +#define WITNESS_RANK_ARENA_NODE_CACHE 11U -#define WITNESS_RANK_BASE 11U +#define WITNESS_RANK_BASE 12U #define WITNESS_RANK_LEAF 0xffffffffU #define WITNESS_RANK_ARENA_BIN WITNESS_RANK_LEAF |