PA: Make mapped stat atomic.

We always have atomic_zu_t, and mapped/unmapped transitions are always expensive
enough that trying to piggyback on a lock is a waste of time.
This commit is contained in:
David Goldblatt
2020-03-11 18:37:15 -07:00
committed by David Goldblatt
parent 3c28aa6f17
commit 436789ad96
6 changed files with 22 additions and 30 deletions

View File

@@ -122,7 +122,8 @@ large_ralloc_no_move_expand(tsdn_t *tsdn, edata_t *edata, size_t usize,
}
if (config_stats && mapped_add > 0) {
pa_shard_stats_mapped_add(tsdn, &arena->pa_shard, mapped_add);
atomic_fetch_add_zu(&arena->pa_shard.stats->mapped, mapped_add,
ATOMIC_RELAXED);
}
if (zero) {