PA: Move edata_avail stat in, make it non-atomic.

This commit is contained in:
David Goldblatt 2020-03-11 18:14:53 -07:00 committed by David Goldblatt
parent f6bfa3dcca
commit 3c28aa6f17
5 changed files with 8 additions and 13 deletions

View File

@ -52,9 +52,6 @@ struct arena_stats_s {
*/ */
locked_zu_t retained; /* Derived. */ locked_zu_t retained; /* Derived. */
/* Number of edata_t structs allocated by base, but not being used. */
atomic_zu_t edata_avail; /* Derived. */
atomic_zu_t base; /* Derived. */ atomic_zu_t base; /* Derived. */
atomic_zu_t internal; atomic_zu_t internal;
atomic_zu_t resident; /* Derived. */ atomic_zu_t resident; /* Derived. */

View File

@ -69,6 +69,9 @@ struct pa_shard_stats_s {
*/ */
locked_zu_t mapped; locked_zu_t mapped;
/* Number of edata_t structs allocated by base, but not being used. */
size_t edata_avail; /* Derived. */
/* VM space had to be leaked (undocumented). Normally 0. */ /* VM space had to be leaked (undocumented). Normally 0. */
atomic_zu_t abandoned_vm; atomic_zu_t abandoned_vm;
}; };

View File

@ -100,9 +100,8 @@ arena_stats_merge(tsdn_t *tsdn, arena_t *arena, unsigned *nthreads,
locked_inc_zu_unsynchronized(&astats->retained, locked_inc_zu_unsynchronized(&astats->retained,
ecache_npages_get(&arena->pa_shard.ecache_retained) << LG_PAGE); ecache_npages_get(&arena->pa_shard.ecache_retained) << LG_PAGE);
atomic_store_zu(&astats->edata_avail, astats->pa_shard_stats.edata_avail = atomic_load_zu(
atomic_load_zu(&arena->pa_shard.edata_cache.count, ATOMIC_RELAXED), &arena->pa_shard.edata_cache.count, ATOMIC_RELAXED);
ATOMIC_RELAXED);
/* Dirty decay stats */ /* Dirty decay stats */
locked_inc_u64_unsynchronized( locked_inc_u64_unsynchronized(

View File

@ -866,8 +866,8 @@ ctl_arena_stats_sdmerge(ctl_arena_t *ctl_sdarena, ctl_arena_t *ctl_arena,
&astats->astats.pa_shard_stats.mapped); &astats->astats.pa_shard_stats.mapped);
ctl_accum_locked_zu(&sdstats->astats.retained, ctl_accum_locked_zu(&sdstats->astats.retained,
&astats->astats.retained); &astats->astats.retained);
ctl_accum_atomic_zu(&sdstats->astats.edata_avail, sdstats->astats.pa_shard_stats.edata_avail
&astats->astats.edata_avail); += astats->astats.pa_shard_stats.edata_avail;
} }
ctl_accum_locked_u64( ctl_accum_locked_u64(
@ -2919,9 +2919,7 @@ CTL_RO_CGEN(config_stats, stats_arenas_i_retained,
locked_read_atomic_zu(&arenas_i(mib[2])->astats->astats.retained), locked_read_atomic_zu(&arenas_i(mib[2])->astats->astats.retained),
size_t) size_t)
CTL_RO_CGEN(config_stats, stats_arenas_i_extent_avail, CTL_RO_CGEN(config_stats, stats_arenas_i_extent_avail,
atomic_load_zu(&arenas_i(mib[2])->astats->astats.edata_avail, arenas_i(mib[2])->astats->astats.pa_shard_stats.edata_avail, size_t)
ATOMIC_RELAXED),
size_t)
CTL_RO_CGEN(config_stats, stats_arenas_i_dirty_npurge, CTL_RO_CGEN(config_stats, stats_arenas_i_dirty_npurge,
locked_read_u64_unsynchronized( locked_read_u64_unsynchronized(

View File

@ -368,5 +368,3 @@ pa_maybe_decay_purge(tsdn_t *tsdn, pa_shard_t *shard, decay_t *decay,
return epoch_advanced; return epoch_advanced;
} }