Profile per arena base mutex, instead of just a0.
This commit is contained in:
parent
d3fde1c124
commit
362e356675
@ -2,7 +2,6 @@
|
|||||||
#define JEMALLOC_INTERNAL_CTL_TYPES_H
|
#define JEMALLOC_INTERNAL_CTL_TYPES_H
|
||||||
|
|
||||||
#define GLOBAL_PROF_MUTEXES \
|
#define GLOBAL_PROF_MUTEXES \
|
||||||
OP(base) \
|
|
||||||
OP(ctl) \
|
OP(ctl) \
|
||||||
OP(prof)
|
OP(prof)
|
||||||
|
|
||||||
@ -21,6 +20,7 @@ typedef enum {
|
|||||||
OP(extents_retained) \
|
OP(extents_retained) \
|
||||||
OP(decay_dirty) \
|
OP(decay_dirty) \
|
||||||
OP(decay_muzzy) \
|
OP(decay_muzzy) \
|
||||||
|
OP(base) \
|
||||||
OP(tcache_list)
|
OP(tcache_list)
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -318,6 +318,8 @@ arena_stats_merge(tsdn_t *tsdn, arena_t *arena, unsigned *nthreads,
|
|||||||
arena_prof_mutex_decay_dirty)
|
arena_prof_mutex_decay_dirty)
|
||||||
READ_ARENA_MUTEX_PROF_DATA(decay_muzzy.mtx,
|
READ_ARENA_MUTEX_PROF_DATA(decay_muzzy.mtx,
|
||||||
arena_prof_mutex_decay_muzzy)
|
arena_prof_mutex_decay_muzzy)
|
||||||
|
READ_ARENA_MUTEX_PROF_DATA(base->mtx,
|
||||||
|
arena_prof_mutex_base)
|
||||||
#undef READ_ARENA_MUTEX_PROF_DATA
|
#undef READ_ARENA_MUTEX_PROF_DATA
|
||||||
|
|
||||||
for (szind_t i = 0; i < NBINS; i++) {
|
for (szind_t i = 0; i < NBINS; i++) {
|
||||||
|
@ -912,8 +912,6 @@ ctl_refresh(tsdn_t *tsdn) {
|
|||||||
malloc_mutex_prof_read(tsdn, &ctl_stats->mutex_prof_data[i], &mtx); \
|
malloc_mutex_prof_read(tsdn, &ctl_stats->mutex_prof_data[i], &mtx); \
|
||||||
malloc_mutex_unlock(tsdn, &mtx);
|
malloc_mutex_unlock(tsdn, &mtx);
|
||||||
|
|
||||||
READ_GLOBAL_MUTEX_PROF_DATA(global_prof_mutex_base,
|
|
||||||
b0get()->mtx);
|
|
||||||
if (config_prof && opt_prof) {
|
if (config_prof && opt_prof) {
|
||||||
READ_GLOBAL_MUTEX_PROF_DATA(global_prof_mutex_prof,
|
READ_GLOBAL_MUTEX_PROF_DATA(global_prof_mutex_prof,
|
||||||
bt2gctx_mtx);
|
bt2gctx_mtx);
|
||||||
@ -2460,12 +2458,12 @@ stats_mutexes_reset_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
|||||||
malloc_mutex_prof_data_reset(tsdn, &mtx); \
|
malloc_mutex_prof_data_reset(tsdn, &mtx); \
|
||||||
malloc_mutex_unlock(tsdn, &mtx);
|
malloc_mutex_unlock(tsdn, &mtx);
|
||||||
|
|
||||||
/* Global mutexes: base, prof and ctl. */
|
/* Global mutexes: ctl and prof. */
|
||||||
MUTEX_PROF_RESET(b0get()->mtx);
|
MUTEX_PROF_RESET(ctl_mtx);
|
||||||
if (config_prof && opt_prof) {
|
if (config_prof && opt_prof) {
|
||||||
MUTEX_PROF_RESET(bt2gctx_mtx);
|
MUTEX_PROF_RESET(bt2gctx_mtx);
|
||||||
}
|
}
|
||||||
MUTEX_PROF_RESET(ctl_mtx);
|
|
||||||
|
|
||||||
/* Per arena mutexes. */
|
/* Per arena mutexes. */
|
||||||
unsigned n = narenas_total_get();
|
unsigned n = narenas_total_get();
|
||||||
@ -2485,6 +2483,7 @@ stats_mutexes_reset_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
|||||||
if (config_tcache) {
|
if (config_tcache) {
|
||||||
MUTEX_PROF_RESET(arena->tcache_ql_mtx);
|
MUTEX_PROF_RESET(arena->tcache_ql_mtx);
|
||||||
}
|
}
|
||||||
|
MUTEX_PROF_RESET(arena->base->mtx);
|
||||||
|
|
||||||
for (szind_t i = 0; i < NBINS; i++) {
|
for (szind_t i = 0; i < NBINS; i++) {
|
||||||
arena_bin_t *bin = &arena->bins[i];
|
arena_bin_t *bin = &arena->bins[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user