Rename extents -> ecache.
This commit is contained in:
parent
56cc56b692
commit
2f4fa80414
@ -26,15 +26,15 @@ extern size_t opt_lg_extent_max_active_fit;
|
|||||||
|
|
||||||
extern rtree_t extents_rtree;
|
extern rtree_t extents_rtree;
|
||||||
|
|
||||||
edata_t *extents_alloc(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
edata_t *ecache_alloc(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
||||||
ecache_t *ecache, void *new_addr, size_t size, size_t pad, size_t alignment,
|
ecache_t *ecache, void *new_addr, size_t size, size_t pad, size_t alignment,
|
||||||
bool slab, szind_t szind, bool *zero, bool *commit);
|
bool slab, szind_t szind, bool *zero, bool *commit);
|
||||||
edata_t *extents_alloc_grow(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
edata_t *ecache_alloc_grow(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
||||||
ecache_t *ecache, void *new_addr, size_t size, size_t pad, size_t alignment,
|
ecache_t *ecache, void *new_addr, size_t size, size_t pad, size_t alignment,
|
||||||
bool slab, szind_t szind, bool *zero, bool *commit);
|
bool slab, szind_t szind, bool *zero, bool *commit);
|
||||||
void extents_dalloc(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
void ecache_dalloc(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
||||||
ecache_t *ecache, edata_t *edata);
|
ecache_t *ecache, edata_t *edata);
|
||||||
edata_t *extents_evict(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
edata_t *ecache_evict(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
||||||
ecache_t *ecache, size_t npages_min);
|
ecache_t *ecache, size_t npages_min);
|
||||||
|
|
||||||
edata_t *extent_alloc_wrapper(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
edata_t *extent_alloc_wrapper(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
||||||
|
23
src/arena.c
23
src/arena.c
@ -258,7 +258,7 @@ arena_extents_dirty_dalloc(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
|||||||
witness_assert_depth_to_rank(tsdn_witness_tsdp_get(tsdn),
|
witness_assert_depth_to_rank(tsdn_witness_tsdp_get(tsdn),
|
||||||
WITNESS_RANK_CORE, 0);
|
WITNESS_RANK_CORE, 0);
|
||||||
|
|
||||||
extents_dalloc(tsdn, arena, ehooks, &arena->ecache_dirty, edata);
|
ecache_dalloc(tsdn, arena, ehooks, &arena->ecache_dirty, edata);
|
||||||
if (arena_dirty_decay_ms_get(arena) == 0) {
|
if (arena_dirty_decay_ms_get(arena) == 0) {
|
||||||
arena_decay_dirty(tsdn, arena, false, true);
|
arena_decay_dirty(tsdn, arena, false, true);
|
||||||
} else {
|
} else {
|
||||||
@ -434,17 +434,16 @@ arena_extent_alloc_large(tsdn_t *tsdn, arena_t *arena, size_t usize,
|
|||||||
szind_t szind = sz_size2index(usize);
|
szind_t szind = sz_size2index(usize);
|
||||||
size_t mapped_add;
|
size_t mapped_add;
|
||||||
bool commit = true;
|
bool commit = true;
|
||||||
edata_t *edata = extents_alloc(tsdn, arena, ehooks,
|
edata_t *edata = ecache_alloc(tsdn, arena, ehooks, &arena->ecache_dirty,
|
||||||
&arena->ecache_dirty, NULL, usize, sz_large_pad, alignment, false,
|
NULL, usize, sz_large_pad, alignment, false, szind, zero, &commit);
|
||||||
szind, zero, &commit);
|
|
||||||
if (edata == NULL && arena_may_have_muzzy(arena)) {
|
if (edata == NULL && arena_may_have_muzzy(arena)) {
|
||||||
edata = extents_alloc(tsdn, arena, ehooks, &arena->ecache_muzzy,
|
edata = ecache_alloc(tsdn, arena, ehooks, &arena->ecache_muzzy,
|
||||||
NULL, usize, sz_large_pad, alignment, false, szind, zero,
|
NULL, usize, sz_large_pad, alignment, false, szind, zero,
|
||||||
&commit);
|
&commit);
|
||||||
}
|
}
|
||||||
size_t size = usize + sz_large_pad;
|
size_t size = usize + sz_large_pad;
|
||||||
if (edata == NULL) {
|
if (edata == NULL) {
|
||||||
edata = extents_alloc_grow(tsdn, arena, ehooks,
|
edata = ecache_alloc_grow(tsdn, arena, ehooks,
|
||||||
&arena->ecache_retained, NULL, usize, sz_large_pad,
|
&arena->ecache_retained, NULL, usize, sz_large_pad,
|
||||||
alignment, false, szind, zero, &commit);
|
alignment, false, szind, zero, &commit);
|
||||||
if (config_stats) {
|
if (config_stats) {
|
||||||
@ -828,7 +827,7 @@ arena_stash_decayed(tsdn_t *tsdn, arena_t *arena,
|
|||||||
size_t nstashed = 0;
|
size_t nstashed = 0;
|
||||||
edata_t *edata;
|
edata_t *edata;
|
||||||
while (nstashed < npages_decay_max &&
|
while (nstashed < npages_decay_max &&
|
||||||
(edata = extents_evict(tsdn, arena, ehooks, ecache, npages_limit))
|
(edata = ecache_evict(tsdn, arena, ehooks, ecache, npages_limit))
|
||||||
!= NULL) {
|
!= NULL) {
|
||||||
edata_list_append(decay_extents, edata);
|
edata_list_append(decay_extents, edata);
|
||||||
nstashed += edata_size_get(edata) >> LG_PAGE;
|
nstashed += edata_size_get(edata) >> LG_PAGE;
|
||||||
@ -865,7 +864,7 @@ arena_decay_stashed(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
|||||||
if (!all && muzzy_decay_ms != 0 &&
|
if (!all && muzzy_decay_ms != 0 &&
|
||||||
!extent_purge_lazy_wrapper(tsdn, arena,
|
!extent_purge_lazy_wrapper(tsdn, arena,
|
||||||
ehooks, edata, 0, edata_size_get(edata))) {
|
ehooks, edata, 0, edata_size_get(edata))) {
|
||||||
extents_dalloc(tsdn, arena, ehooks,
|
ecache_dalloc(tsdn, arena, ehooks,
|
||||||
&arena->ecache_muzzy, edata);
|
&arena->ecache_muzzy, edata);
|
||||||
arena_background_thread_inactivity_check(tsdn,
|
arena_background_thread_inactivity_check(tsdn,
|
||||||
arena, is_background_thread);
|
arena, is_background_thread);
|
||||||
@ -1158,7 +1157,7 @@ arena_destroy_retained(tsdn_t *tsdn, arena_t *arena) {
|
|||||||
*/
|
*/
|
||||||
ehooks_t *ehooks = arena_get_ehooks(arena);
|
ehooks_t *ehooks = arena_get_ehooks(arena);
|
||||||
edata_t *edata;
|
edata_t *edata;
|
||||||
while ((edata = extents_evict(tsdn, arena, ehooks,
|
while ((edata = ecache_evict(tsdn, arena, ehooks,
|
||||||
&arena->ecache_retained, 0)) != NULL) {
|
&arena->ecache_retained, 0)) != NULL) {
|
||||||
extent_destroy_wrapper(tsdn, arena, ehooks, edata);
|
extent_destroy_wrapper(tsdn, arena, ehooks, edata);
|
||||||
}
|
}
|
||||||
@ -1211,7 +1210,7 @@ arena_slab_alloc_hard(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
|||||||
|
|
||||||
zero = false;
|
zero = false;
|
||||||
commit = true;
|
commit = true;
|
||||||
slab = extents_alloc_grow(tsdn, arena, ehooks, &arena->ecache_retained,
|
slab = ecache_alloc_grow(tsdn, arena, ehooks, &arena->ecache_retained,
|
||||||
NULL, bin_info->slab_size, 0, PAGE, true, szind, &zero, &commit);
|
NULL, bin_info->slab_size, 0, PAGE, true, szind, &zero, &commit);
|
||||||
|
|
||||||
if (config_stats && slab != NULL) {
|
if (config_stats && slab != NULL) {
|
||||||
@ -1232,10 +1231,10 @@ arena_slab_alloc(tsdn_t *tsdn, arena_t *arena, szind_t binind, unsigned binshard
|
|||||||
szind_t szind = sz_size2index(bin_info->reg_size);
|
szind_t szind = sz_size2index(bin_info->reg_size);
|
||||||
bool zero = false;
|
bool zero = false;
|
||||||
bool commit = true;
|
bool commit = true;
|
||||||
edata_t *slab = extents_alloc(tsdn, arena, ehooks, &arena->ecache_dirty,
|
edata_t *slab = ecache_alloc(tsdn, arena, ehooks, &arena->ecache_dirty,
|
||||||
NULL, bin_info->slab_size, 0, PAGE, true, binind, &zero, &commit);
|
NULL, bin_info->slab_size, 0, PAGE, true, binind, &zero, &commit);
|
||||||
if (slab == NULL && arena_may_have_muzzy(arena)) {
|
if (slab == NULL && arena_may_have_muzzy(arena)) {
|
||||||
slab = extents_alloc(tsdn, arena, ehooks, &arena->ecache_muzzy,
|
slab = ecache_alloc(tsdn, arena, ehooks, &arena->ecache_muzzy,
|
||||||
NULL, bin_info->slab_size, 0, PAGE, true, binind, &zero,
|
NULL, bin_info->slab_size, 0, PAGE, true, binind, &zero,
|
||||||
&commit);
|
&commit);
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,7 @@ extent_try_delayed_coalesce(tsdn_t *tsdn, edata_cache_t *edata_cache,
|
|||||||
}
|
}
|
||||||
|
|
||||||
edata_t *
|
edata_t *
|
||||||
extents_alloc(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks, ecache_t *ecache,
|
ecache_alloc(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks, ecache_t *ecache,
|
||||||
void *new_addr, size_t size, size_t pad, size_t alignment, bool slab,
|
void *new_addr, size_t size, size_t pad, size_t alignment, bool slab,
|
||||||
szind_t szind, bool *zero, bool *commit) {
|
szind_t szind, bool *zero, bool *commit) {
|
||||||
assert(size + pad != 0);
|
assert(size + pad != 0);
|
||||||
@ -199,7 +199,7 @@ extents_alloc(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks, ecache_t *ecache,
|
|||||||
}
|
}
|
||||||
|
|
||||||
edata_t *
|
edata_t *
|
||||||
extents_alloc_grow(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
ecache_alloc_grow(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
||||||
ecache_t *ecache, void *new_addr, size_t size, size_t pad, size_t alignment,
|
ecache_t *ecache, void *new_addr, size_t size, size_t pad, size_t alignment,
|
||||||
bool slab, szind_t szind, bool *zero, bool *commit) {
|
bool slab, szind_t szind, bool *zero, bool *commit) {
|
||||||
assert(size + pad != 0);
|
assert(size + pad != 0);
|
||||||
@ -228,7 +228,7 @@ extents_alloc_grow(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
extents_dalloc(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks, ecache_t *ecache,
|
ecache_dalloc(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks, ecache_t *ecache,
|
||||||
edata_t *edata) {
|
edata_t *edata) {
|
||||||
assert(edata_base_get(edata) != NULL);
|
assert(edata_base_get(edata) != NULL);
|
||||||
assert(edata_size_get(edata) != 0);
|
assert(edata_size_get(edata) != 0);
|
||||||
@ -243,7 +243,7 @@ extents_dalloc(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks, ecache_t *ecache,
|
|||||||
}
|
}
|
||||||
|
|
||||||
edata_t *
|
edata_t *
|
||||||
extents_evict(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks, ecache_t *ecache,
|
ecache_evict(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks, ecache_t *ecache,
|
||||||
size_t npages_min) {
|
size_t npages_min) {
|
||||||
rtree_ctx_t rtree_ctx_fallback;
|
rtree_ctx_t rtree_ctx_fallback;
|
||||||
rtree_ctx_t *rtree_ctx = tsdn_rtree_ctx(tsdn, &rtree_ctx_fallback);
|
rtree_ctx_t *rtree_ctx = tsdn_rtree_ctx(tsdn, &rtree_ctx_fallback);
|
||||||
|
@ -149,17 +149,17 @@ large_ralloc_no_move_expand(tsdn_t *tsdn, edata_t *edata, size_t usize,
|
|||||||
bool commit = true;
|
bool commit = true;
|
||||||
edata_t *trail;
|
edata_t *trail;
|
||||||
bool new_mapping;
|
bool new_mapping;
|
||||||
if ((trail = extents_alloc(tsdn, arena, ehooks, &arena->ecache_dirty,
|
if ((trail = ecache_alloc(tsdn, arena, ehooks, &arena->ecache_dirty,
|
||||||
edata_past_get(edata), trailsize, 0, CACHELINE, false, SC_NSIZES,
|
edata_past_get(edata), trailsize, 0, CACHELINE, false, SC_NSIZES,
|
||||||
&is_zeroed_trail, &commit)) != NULL
|
&is_zeroed_trail, &commit)) != NULL
|
||||||
|| (trail = extents_alloc(tsdn, arena, ehooks, &arena->ecache_muzzy,
|
|| (trail = ecache_alloc(tsdn, arena, ehooks, &arena->ecache_muzzy,
|
||||||
edata_past_get(edata), trailsize, 0, CACHELINE, false, SC_NSIZES,
|
edata_past_get(edata), trailsize, 0, CACHELINE, false, SC_NSIZES,
|
||||||
&is_zeroed_trail, &commit)) != NULL) {
|
&is_zeroed_trail, &commit)) != NULL) {
|
||||||
if (config_stats) {
|
if (config_stats) {
|
||||||
new_mapping = false;
|
new_mapping = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((trail = extents_alloc_grow(tsdn, arena, ehooks,
|
if ((trail = ecache_alloc_grow(tsdn, arena, ehooks,
|
||||||
&arena->ecache_retained, edata_past_get(edata), trailsize,
|
&arena->ecache_retained, edata_past_get(edata), trailsize,
|
||||||
0, CACHELINE, false, SC_NSIZES, &is_zeroed_trail, &commit))
|
0, CACHELINE, false, SC_NSIZES, &is_zeroed_trail, &commit))
|
||||||
== NULL) {
|
== NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user