Arena stats: Move retained to PA, use plain ints.

Retained is a property of the allocated pages.  The derived fields no longer
require any locking; they're computed on demand.
This commit is contained in:
David Goldblatt
2020-03-11 19:24:05 -07:00
committed by David Goldblatt
parent e2cf3fb1a3
commit d0c43217b5
4 changed files with 44 additions and 44 deletions

View File

@@ -45,17 +45,16 @@ struct arena_stats_large_s {
typedef struct arena_stats_s arena_stats_t;
struct arena_stats_s {
LOCKEDINT_MTX_DECLARE(mtx)
/*
* Number of unused virtual memory bytes currently retained. Retained
* bytes are technically mapped (though always decommitted or purged),
* but they are excluded from the mapped statistic (above).
*/
locked_zu_t retained; /* Derived. */
atomic_zu_t base; /* Derived. */
/*
* resident includes the base stats -- that's why it lives here and not
* in pa_shard_stats_t.
*/
size_t base; /* Derived. */
size_t resident; /* Derived. */
size_t metadata_thp; /* Derived. */
atomic_zu_t internal;
atomic_zu_t resident; /* Derived. */
atomic_zu_t metadata_thp;
atomic_zu_t allocated_large; /* Derived. */
locked_u64_t nmalloc_large; /* Derived. */

View File

@@ -61,6 +61,14 @@ typedef struct pa_shard_stats_s pa_shard_stats_t;
struct pa_shard_stats_s {
pa_shard_decay_stats_t decay_dirty;
pa_shard_decay_stats_t decay_muzzy;
/*
* Number of unused virtual memory bytes currently retained. Retained
* bytes are technically mapped (though always decommitted or purged),
* but they are excluded from the mapped statistic (above).
*/
size_t retained; /* Derived. */
/*
* Number of bytes currently mapped, excluding retained memory.
*