Rename ecache_grow -> geom_grow.

We're about to start using it outside of the ecaches, in the HPA central
allocator.
This commit is contained in:
David Goldblatt
2020-08-07 18:03:40 -07:00
committed by David Goldblatt
parent b399463fba
commit 131b1b5338
10 changed files with 84 additions and 74 deletions

View File

@@ -19,26 +19,6 @@ struct ecache_s {
bool delay_coalesce;
};
typedef struct ecache_grow_s ecache_grow_t;
struct ecache_grow_s {
/*
* Next extent size class in a growing series to use when satisfying a
* request via the extent hooks (only if opt_retain). This limits the
* number of disjoint virtual memory ranges so that extent merging can
* be effective even if multiple arenas' extent allocation requests are
* highly interleaved.
*
* retain_grow_limit is the max allowed size ind to expand (unless the
* required size is greater). Default is no limit, and controlled
* through mallctl only.
*
* Synchronization: extent_grow_mtx
*/
pszind_t next;
pszind_t limit;
malloc_mutex_t mtx;
};
static inline size_t
ecache_npages_get(ecache_t *ecache) {
return eset_npages_get(&ecache->eset);
@@ -65,9 +45,4 @@ void ecache_prefork(tsdn_t *tsdn, ecache_t *ecache);
void ecache_postfork_parent(tsdn_t *tsdn, ecache_t *ecache);
void ecache_postfork_child(tsdn_t *tsdn, ecache_t *ecache);
bool ecache_grow_init(tsdn_t *tsdn, ecache_grow_t *ecache_grow);
void ecache_grow_prefork(tsdn_t *tsdn, ecache_grow_t *ecache_grow);
void ecache_grow_postfork_parent(tsdn_t *tsdn, ecache_grow_t *ecache_grow);
void ecache_grow_postfork_child(tsdn_t *tsdn, ecache_grow_t *ecache_grow);
#endif /* JEMALLOC_INTERNAL_ECACHE_H */

View File

@@ -0,0 +1,29 @@
#ifndef JEMALLOC_INTERNAL_ECACHE_GROW_H
#define JEMALLOC_INTERNAL_ECACHE_GROW_H
typedef struct geom_grow_s geom_grow_t;
struct geom_grow_s {
/*
* Next extent size class in a growing series to use when satisfying a
* request via the extent hooks (only if opt_retain). This limits the
* number of disjoint virtual memory ranges so that extent merging can
* be effective even if multiple arenas' extent allocation requests are
* highly interleaved.
*
* retain_grow_limit is the max allowed size ind to expand (unless the
* required size is greater). Default is no limit, and controlled
* through mallctl only.
*
* Synchronization: mtx
*/
pszind_t next;
pszind_t limit;
malloc_mutex_t mtx;
};
bool geom_grow_init(tsdn_t *tsdn, geom_grow_t *geom_grow);
void geom_grow_prefork(tsdn_t *tsdn, geom_grow_t *geom_grow);
void geom_grow_postfork_parent(tsdn_t *tsdn, geom_grow_t *geom_grow);
void geom_grow_postfork_child(tsdn_t *tsdn, geom_grow_t *geom_grow);
#endif /* JEMALLOC_INTERNAL_ECACHE_GROW_H */

View File

@@ -1,8 +1,10 @@
#ifndef JEMALLOC_INTERNAL_PAC_H
#define JEMALLOC_INTERNAL_PAC_H
#include "jemalloc/internal/geom_grow.h"
#include "jemalloc/internal/pai.h"
/*
* Page allocator classic; an implementation of the PAI interface that:
* - Can be used for arenas with custom extent hooks.
@@ -93,7 +95,7 @@ struct pac_s {
edata_cache_t *edata_cache;
/* The grow info for the retained ecache. */
ecache_grow_t ecache_grow;
geom_grow_t geom_grow;
/*
* Decay-based purging state, responsible for scheduling extent state