Synchronize arena->decay with arena->decay.mtx.

This removes the last use of arena->lock.
This commit is contained in:
Jason Evans
2017-02-13 11:02:32 -08:00
parent d433471f58
commit f8fee6908d
4 changed files with 35 additions and 33 deletions

View File

@@ -81,7 +81,7 @@ arena_decay_ticks(tsdn_t *tsdn, arena_t *arena, unsigned nticks) {
JEMALLOC_ALWAYS_INLINE void
arena_decay_tick(tsdn_t *tsdn, arena_t *arena) {
malloc_mutex_assert_not_owner(tsdn, &arena->lock);
malloc_mutex_assert_not_owner(tsdn, &arena->decay.mtx);
arena_decay_ticks(tsdn, arena, 1);
}

View File

@@ -37,6 +37,8 @@ struct arena_bin_info_s {
};
struct arena_decay_s {
/* Synchronizes all fields. */
malloc_mutex_t mtx;
/*
* Approximate time in seconds from the creation of a set of unused
* dirty pages until an equivalent set of unused dirty pages is purged
@@ -121,12 +123,6 @@ struct arena_s {
*/
unsigned nthreads[2];
/*
* Synchronizes various arena operations, as indicated in field-specific
* comments.
*/
malloc_mutex_t lock;
/* Synchronization: internal. */
arena_stats_t stats;

View File

@@ -34,7 +34,7 @@ typedef int witness_comp_t (const witness_t *, void *, const witness_t *,
*/
#define WITNESS_RANK_CORE 9U
#define WITNESS_RANK_ARENA 9U
#define WITNESS_RANK_DECAY 9U
#define WITNESS_RANK_TCACHE_QL 10U
#define WITNESS_RANK_EXTENTS 11U
#define WITNESS_RANK_EXTENT_FREELIST 12U