summaryrefslogtreecommitdiffstats
path: root/include/jemalloc
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-04-26 06:14:40 (GMT)
committerJason Evans <jasone@canonware.com>2016-04-26 06:16:20 (GMT)
commit174c0c3a9c63b3a0bfa32381148b537e9b9af96d (patch)
treee8e8b7d7793e2bebee876edb1744f6db4d854f1a /include/jemalloc
parent0d970a054e5477cd6cf3639366bcc0a1a4f61b11 (diff)
downloadjemalloc-174c0c3a9c63b3a0bfa32381148b537e9b9af96d.zip
jemalloc-174c0c3a9c63b3a0bfa32381148b537e9b9af96d.tar.gz
jemalloc-174c0c3a9c63b3a0bfa32381148b537e9b9af96d.tar.bz2
Fix fork()-related lock rank ordering reversals.
Diffstat (limited to 'include/jemalloc')
-rw-r--r--include/jemalloc/internal/arena.h5
-rw-r--r--include/jemalloc/internal/private_symbols.txt11
-rw-r--r--include/jemalloc/internal/prof.h3
-rw-r--r--include/jemalloc/internal/tsd.h4
-rw-r--r--include/jemalloc/internal/witness.h3
5 files changed, 21 insertions, 5 deletions
diff --git a/include/jemalloc/internal/arena.h b/include/jemalloc/internal/arena.h
index f2685f6..53e6b3a 100644
--- a/include/jemalloc/internal/arena.h
+++ b/include/jemalloc/internal/arena.h
@@ -601,7 +601,10 @@ void arena_nthreads_inc(arena_t *arena, bool internal);
void arena_nthreads_dec(arena_t *arena, bool internal);
arena_t *arena_new(tsd_t *tsd, unsigned ind);
bool arena_boot(void);
-void arena_prefork(tsd_t *tsd, arena_t *arena);
+void arena_prefork0(tsd_t *tsd, arena_t *arena);
+void arena_prefork1(tsd_t *tsd, arena_t *arena);
+void arena_prefork2(tsd_t *tsd, arena_t *arena);
+void arena_prefork3(tsd_t *tsd, arena_t *arena);
void arena_postfork_parent(tsd_t *tsd, arena_t *arena);
void arena_postfork_child(tsd_t *tsd, arena_t *arena);
diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt
index c7ff852..0eb7778 100644
--- a/include/jemalloc/internal/private_symbols.txt
+++ b/include/jemalloc/internal/private_symbols.txt
@@ -84,7 +84,10 @@ arena_nthreads_inc
arena_palloc
arena_postfork_child
arena_postfork_parent
-arena_prefork
+arena_prefork0
+arena_prefork1
+arena_prefork2
+arena_prefork3
arena_prof_accum
arena_prof_accum_impl
arena_prof_accum_locked
@@ -432,7 +435,8 @@ prof_malloc_sample_object
prof_mdump
prof_postfork_child
prof_postfork_parent
-prof_prefork
+prof_prefork0
+prof_prefork1
prof_realloc
prof_reset
prof_sample_accum_update
@@ -583,11 +587,14 @@ valgrind_make_mem_undefined
witness_assert_lockless
witness_assert_not_owner
witness_assert_owner
+witness_fork_cleanup
witness_init
witness_lock
witness_lock_error
witness_lockless_error
witness_not_owner_error
witness_owner_error
+witness_postfork
+witness_prefork
witness_unlock
witnesses_cleanup
diff --git a/include/jemalloc/internal/prof.h b/include/jemalloc/internal/prof.h
index 047bd0b..4fe1787 100644
--- a/include/jemalloc/internal/prof.h
+++ b/include/jemalloc/internal/prof.h
@@ -316,7 +316,8 @@ bool prof_gdump_set(tsd_t *tsd, bool active);
void prof_boot0(void);
void prof_boot1(void);
bool prof_boot2(tsd_t *tsd);
-void prof_prefork(tsd_t *tsd);
+void prof_prefork0(tsd_t *tsd);
+void prof_prefork1(tsd_t *tsd);
void prof_postfork_parent(tsd_t *tsd);
void prof_postfork_child(tsd_t *tsd);
void prof_sample_threshold_update(prof_tdata_t *tdata);
diff --git a/include/jemalloc/internal/tsd.h b/include/jemalloc/internal/tsd.h
index 1a1b5c3..4a99ee6 100644
--- a/include/jemalloc/internal/tsd.h
+++ b/include/jemalloc/internal/tsd.h
@@ -544,6 +544,7 @@ struct tsd_init_head_s {
O(tcache_enabled, tcache_enabled_t) \
O(quarantine, quarantine_t *) \
O(witnesses, witness_list_t) \
+ O(witness_fork, bool) \
#define TSD_INITIALIZER { \
tsd_state_uninitialized, \
@@ -558,7 +559,8 @@ struct tsd_init_head_s {
false, \
tcache_enabled_default, \
NULL, \
- ql_head_initializer(witnesses) \
+ ql_head_initializer(witnesses), \
+ false \
}
struct tsd_s {
diff --git a/include/jemalloc/internal/witness.h b/include/jemalloc/internal/witness.h
index 22f0b2c..ecdc034 100644
--- a/include/jemalloc/internal/witness.h
+++ b/include/jemalloc/internal/witness.h
@@ -94,6 +94,9 @@ extern witness_lockless_error_t *witness_lockless_error;
void witness_assert_lockless(tsd_t *tsd);
void witnesses_cleanup(tsd_t *tsd);
+void witness_fork_cleanup(tsd_t *tsd);
+void witness_prefork(tsd_t *tsd);
+void witness_postfork(tsd_t *tsd);
#endif /* JEMALLOC_H_EXTERNS */
/******************************************************************************/