mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-21 02:12:15 +03:00
PA: Move in decay stats.
This commit is contained in:
parent
356aaa7dc6
commit
1ad368c8b7
6 changed files with 72 additions and 50 deletions
|
|
@ -150,9 +150,10 @@ arena_decay_extent(tsdn_t *tsdn,arena_t *arena, ehooks_t *ehooks,
|
|||
/* Update stats accordingly. */
|
||||
LOCKEDINT_MTX_LOCK(tsdn, arena->stats.mtx);
|
||||
locked_inc_u64(tsdn, LOCKEDINT_MTX(arena->stats.mtx),
|
||||
&arena->decay_dirty.stats->nmadvise, 1);
|
||||
&arena->pa_shard.stats->decay_dirty.nmadvise, 1);
|
||||
locked_inc_u64(tsdn, LOCKEDINT_MTX(arena->stats.mtx),
|
||||
&arena->decay_dirty.stats->purged, extent_size >> LG_PAGE);
|
||||
&arena->pa_shard.stats->decay_dirty.purged,
|
||||
extent_size >> LG_PAGE);
|
||||
locked_dec_zu(tsdn, LOCKEDINT_MTX(arena->stats.mtx),
|
||||
&arena->stats.mapped, extent_size);
|
||||
LOCKEDINT_MTX_UNLOCK(tsdn, arena->stats.mtx);
|
||||
|
|
|
|||
|
|
@ -37,16 +37,6 @@ struct arena_stats_large_s {
|
|||
size_t curlextents; /* Derived. */
|
||||
};
|
||||
|
||||
typedef struct arena_stats_decay_s arena_stats_decay_t;
|
||||
struct arena_stats_decay_s {
|
||||
/* Total number of purge sweeps. */
|
||||
locked_u64_t npurge;
|
||||
/* Total number of madvise calls made. */
|
||||
locked_u64_t nmadvise;
|
||||
/* Total number of pages purged. */
|
||||
locked_u64_t purged;
|
||||
};
|
||||
|
||||
typedef struct arena_stats_extents_s arena_stats_extents_t;
|
||||
struct arena_stats_extents_s {
|
||||
/*
|
||||
|
|
@ -87,9 +77,6 @@ struct arena_stats_s {
|
|||
/* Number of edata_t structs allocated by base, but not being used. */
|
||||
atomic_zu_t edata_avail;
|
||||
|
||||
arena_stats_decay_t decay_dirty;
|
||||
arena_stats_decay_t decay_muzzy;
|
||||
|
||||
atomic_zu_t base; /* Derived. */
|
||||
atomic_zu_t internal;
|
||||
atomic_zu_t resident; /* Derived. */
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ struct arena_decay_s {
|
|||
* arena and ctl code.
|
||||
*
|
||||
* Synchronization: Same as associated arena's stats field. */
|
||||
arena_stats_decay_t *stats;
|
||||
pa_shard_decay_stats_t *stats;
|
||||
/* Peak number of pages in associated extents. Used for debug only. */
|
||||
uint64_t ceil_npages;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,14 +3,27 @@
|
|||
|
||||
#include "jemalloc/internal/ecache.h"
|
||||
#include "jemalloc/internal/edata_cache.h"
|
||||
#include "jemalloc/internal/lockedint.h"
|
||||
|
||||
/*
|
||||
* The page allocator; responsible for acquiring pages of memory for
|
||||
* allocations.
|
||||
*/
|
||||
|
||||
typedef struct pa_shard_decay_stats_s pa_shard_decay_stats_t;
|
||||
struct pa_shard_decay_stats_s {
|
||||
/* Total number of purge sweeps. */
|
||||
locked_u64_t npurge;
|
||||
/* Total number of madvise calls made. */
|
||||
locked_u64_t nmadvise;
|
||||
/* Total number of pages purged. */
|
||||
locked_u64_t purged;
|
||||
};
|
||||
|
||||
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;
|
||||
/* VM space had to be leaked (undocumented). Normally 0. */
|
||||
atomic_zu_t abandoned_vm;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue