HPA: Add stats for the hpa_shard.

This commit is contained in:
David Goldblatt
2020-09-04 12:01:52 -07:00
committed by David Goldblatt
parent 534504d4a7
commit 1964b08394
12 changed files with 230 additions and 16 deletions

View File

@@ -28,7 +28,7 @@ void arena_stats_merge(tsdn_t *tsdn, arena_t *arena, unsigned *nthreads,
const char **dss, ssize_t *dirty_decay_ms, ssize_t *muzzy_decay_ms,
size_t *nactive, size_t *ndirty, size_t *nmuzzy, arena_stats_t *astats,
bin_stats_data_t *bstats, arena_stats_large_t *lstats,
pac_estats_t *estats);
pac_estats_t *estats, hpa_shard_stats_t *hpastats);
void arena_handle_new_dirty_pages(tsdn_t *tsdn, arena_t *arena);
#ifdef JEMALLOC_JET
size_t arena_slab_regind(edata_t *slab, szind_t binind, const void *ptr);

View File

@@ -45,6 +45,7 @@ typedef struct ctl_arena_stats_s {
bin_stats_data_t bstats[SC_NBINS];
arena_stats_large_t lstats[SC_NSIZES - SC_NBINS];
pac_estats_t estats[SC_NPSIZES];
hpa_shard_stats_t hpastats;
} ctl_arena_stats_t;
typedef struct ctl_stats_s {

View File

@@ -29,6 +29,13 @@ struct hpa_s {
geom_grow_t geom_grow;
};
/* Used only by CTL; not actually stored here (i.e., all derived). */
typedef struct hpa_shard_stats_s hpa_shard_stats_t;
struct hpa_shard_stats_s {
psset_bin_stats_t psset_full_slab_stats;
psset_bin_stats_t psset_slab_stats[PSSET_NPSIZES];
};
typedef struct hpa_shard_s hpa_shard_t;
struct hpa_shard_s {
/*

View File

@@ -31,7 +31,9 @@ typedef enum {
OP(decay_dirty) \
OP(decay_muzzy) \
OP(base) \
OP(tcache_list)
OP(tcache_list) \
OP(hpa_shard) \
OP(hpa_shard_grow)
typedef enum {
#define OP(mtx) arena_prof_mutex_##mtx,

View File

@@ -192,7 +192,7 @@ void pa_shard_basic_stats_merge(pa_shard_t *shard, size_t *nactive,
void pa_shard_stats_merge(tsdn_t *tsdn, pa_shard_t *shard,
pa_shard_stats_t *pa_shard_stats_out, pac_estats_t *estats_out,
size_t *resident);
hpa_shard_stats_t *hpa_stats_out, size_t *resident);
/*
* Reads the PA-owned mutex stats into the output stats array, at the

View File

@@ -31,6 +31,13 @@ struct psset_bin_stats_s {
size_t ninactive;
};
static inline void
psset_bin_stats_accum(psset_bin_stats_t *dst, psset_bin_stats_t *src) {
dst->npageslabs += src->npageslabs;
dst->nactive += src->nactive;
dst->ninactive += src->ninactive;
}
typedef struct psset_s psset_t;
struct psset_s {
/*

View File

@@ -11,7 +11,8 @@
OPTION('b', bins, true, false) \
OPTION('l', large, true, false) \
OPTION('x', mutex, true, false) \
OPTION('e', extents, true, false)
OPTION('e', extents, true, false) \
OPTION('h', hpa, config_stats, false)
enum {
#define OPTION(o, v, d, s) stats_print_option_num_##v,