2017-01-11 10:06:31 +08:00
|
|
|
#ifndef JEMALLOC_INTERNAL_CTL_STRUCTS_H
|
|
|
|
#define JEMALLOC_INTERNAL_CTL_STRUCTS_H
|
|
|
|
|
|
|
|
struct ctl_node_s {
|
|
|
|
bool named;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ctl_named_node_s {
|
|
|
|
struct ctl_node_s node;
|
|
|
|
const char *name;
|
|
|
|
/* If (nchildren == 0), this is a terminal node. */
|
|
|
|
size_t nchildren;
|
|
|
|
const ctl_node_t *children;
|
|
|
|
int (*ctl)(tsd_t *, const size_t *, size_t, void *,
|
|
|
|
size_t *, void *, size_t);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ctl_indexed_node_s {
|
|
|
|
struct ctl_node_s node;
|
|
|
|
const ctl_named_node_t *(*index)(tsdn_t *, const size_t *, size_t,
|
|
|
|
size_t);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ctl_arena_stats_s {
|
|
|
|
arena_stats_t astats;
|
|
|
|
|
|
|
|
/* Aggregate stats for small size classes, based on bin stats. */
|
|
|
|
size_t allocated_small;
|
|
|
|
uint64_t nmalloc_small;
|
|
|
|
uint64_t ndalloc_small;
|
|
|
|
uint64_t nrequests_small;
|
|
|
|
|
|
|
|
malloc_bin_stats_t bstats[NBINS];
|
|
|
|
malloc_large_stats_t lstats[NSIZES - NBINS];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ctl_stats_s {
|
|
|
|
size_t allocated;
|
|
|
|
size_t active;
|
|
|
|
size_t metadata;
|
|
|
|
size_t resident;
|
|
|
|
size_t mapped;
|
|
|
|
size_t retained;
|
2017-03-12 12:28:31 +08:00
|
|
|
|
2017-03-22 02:56:38 +08:00
|
|
|
mutex_prof_data_t mutex_prof_data[num_global_prof_mutexes];
|
2017-01-19 15:03:37 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ctl_arena_s {
|
|
|
|
unsigned arena_ind;
|
|
|
|
bool initialized;
|
|
|
|
ql_elm(ctl_arena_t) destroyed_link;
|
|
|
|
|
|
|
|
/* Basic stats, supported even if !config_stats. */
|
|
|
|
unsigned nthreads;
|
|
|
|
const char *dss;
|
Implement two-phase decay-based purging.
Split decay-based purging into two phases, the first of which uses lazy
purging to convert dirty pages to "muzzy", and the second of which uses
forced purging, decommit, or unmapping to convert pages to clean or
destroy them altogether. Not all operating systems support lazy
purging, yet the application may provide extent hooks that implement
lazy purging, so care must be taken to dynamically omit the first phase
when necessary.
The mallctl interfaces change as follows:
- opt.decay_time --> opt.{dirty,muzzy}_decay_time
- arena.<i>.decay_time --> arena.<i>.{dirty,muzzy}_decay_time
- arenas.decay_time --> arenas.{dirty,muzzy}_decay_time
- stats.arenas.<i>.pdirty --> stats.arenas.<i>.p{dirty,muzzy}
- stats.arenas.<i>.{npurge,nmadvise,purged} -->
stats.arenas.<i>.{dirty,muzzy}_{npurge,nmadvise,purged}
This resolves #521.
2017-03-09 14:42:57 +08:00
|
|
|
ssize_t dirty_decay_time;
|
|
|
|
ssize_t muzzy_decay_time;
|
2017-01-19 15:03:37 +08:00
|
|
|
size_t pactive;
|
|
|
|
size_t pdirty;
|
Implement two-phase decay-based purging.
Split decay-based purging into two phases, the first of which uses lazy
purging to convert dirty pages to "muzzy", and the second of which uses
forced purging, decommit, or unmapping to convert pages to clean or
destroy them altogether. Not all operating systems support lazy
purging, yet the application may provide extent hooks that implement
lazy purging, so care must be taken to dynamically omit the first phase
when necessary.
The mallctl interfaces change as follows:
- opt.decay_time --> opt.{dirty,muzzy}_decay_time
- arena.<i>.decay_time --> arena.<i>.{dirty,muzzy}_decay_time
- arenas.decay_time --> arenas.{dirty,muzzy}_decay_time
- stats.arenas.<i>.pdirty --> stats.arenas.<i>.p{dirty,muzzy}
- stats.arenas.<i>.{npurge,nmadvise,purged} -->
stats.arenas.<i>.{dirty,muzzy}_{npurge,nmadvise,purged}
This resolves #521.
2017-03-09 14:42:57 +08:00
|
|
|
size_t pmuzzy;
|
2017-01-19 15:03:37 +08:00
|
|
|
|
|
|
|
/* NULL if !config_stats. */
|
|
|
|
ctl_arena_stats_t *astats;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ctl_arenas_s {
|
|
|
|
uint64_t epoch;
|
2017-01-11 10:06:31 +08:00
|
|
|
unsigned narenas;
|
2017-01-19 15:03:37 +08:00
|
|
|
ql_head(ctl_arena_t) destroyed;
|
|
|
|
|
2017-01-11 10:06:31 +08:00
|
|
|
/*
|
2017-01-19 15:03:37 +08:00
|
|
|
* Element 0 corresponds to merged stats for extant arenas (accessed via
|
|
|
|
* MALLCTL_ARENAS_ALL), element 1 corresponds to merged stats for
|
|
|
|
* destroyed arenas (accessed via MALLCTL_ARENAS_DESTROYED), and the
|
|
|
|
* remaining MALLOCX_ARENA_MAX+1 elements correspond to arenas.
|
2017-01-11 10:06:31 +08:00
|
|
|
*/
|
2017-01-19 15:03:37 +08:00
|
|
|
ctl_arena_t *arenas[MALLOCX_ARENA_MAX + 3];
|
2017-01-11 10:06:31 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* JEMALLOC_INTERNAL_CTL_STRUCTS_H */
|