PA: Add a stats type.

This commit is contained in:
David Goldblatt 2020-03-08 13:08:15 -07:00 committed by David Goldblatt
parent 688fb3eb89
commit 32cb7c2f0b
6 changed files with 35 additions and 11 deletions

View file

@ -131,8 +131,9 @@ arena_stats_merge(tsdn_t *tsdn, arena_t *arena, unsigned *nthreads,
(((atomic_load_zu(&arena->nactive, ATOMIC_RELAXED) +
ecache_npages_get(&arena->pa_shard.ecache_dirty) +
ecache_npages_get(&arena->pa_shard.ecache_muzzy)) << LG_PAGE)));
arena_stats_accum_zu(&astats->abandoned_vm, atomic_load_zu(
&arena->stats.abandoned_vm, ATOMIC_RELAXED));
arena_stats_accum_zu(&astats->pa_shard_stats.abandoned_vm,
atomic_load_zu(&arena->stats.pa_shard_stats.abandoned_vm,
ATOMIC_RELAXED));
for (szind_t i = 0; i < SC_NSIZES - SC_NBINS; i++) {
uint64_t nmalloc = arena_stats_read_u64(tsdn, &arena->stats,
@ -2027,7 +2028,8 @@ arena_new(tsdn_t *tsdn, unsigned ind, extent_hooks_t *extent_hooks) {
goto label_error;
}
if (pa_shard_init(tsdn, &arena->pa_shard, base, ind)) {
if (pa_shard_init(tsdn, &arena->pa_shard, base, ind,
&arena->stats.pa_shard_stats)) {
goto label_error;
}