Emap: Move edata modification out of emap_remap.

This commit is contained in:
David Goldblatt 2020-03-13 18:34:46 -07:00 committed by David Goldblatt
parent 12eb888e54
commit dfef0df71a
4 changed files with 6 additions and 3 deletions

View File

@ -1067,7 +1067,8 @@ arena_prof_promote(tsdn_t *tsdn, void *ptr, size_t usize) {
edata_t *edata = emap_edata_lookup(tsdn, &emap_global, ptr); edata_t *edata = emap_edata_lookup(tsdn, &emap_global, ptr);
szind_t szind = sz_size2index(usize); szind_t szind = sz_size2index(usize);
emap_remap(tsdn, &emap_global, edata, szind, false); edata_szind_set(edata, szind);
emap_remap(tsdn, &emap_global, edata, szind, /* slab */ false);
prof_idump_rollback(tsdn, usize); prof_idump_rollback(tsdn, usize);
@ -1079,7 +1080,8 @@ arena_prof_demote(tsdn_t *tsdn, edata_t *edata, const void *ptr) {
cassert(config_prof); cassert(config_prof);
assert(ptr != NULL); assert(ptr != NULL);
emap_remap(tsdn, &emap_global, edata, SC_NBINS, false); edata_szind_set(edata, SC_NBINS);
emap_remap(tsdn, &emap_global, edata, SC_NBINS, /* slab */ false);
assert(isalloc(tsdn, ptr) == SC_LARGE_MINCLASS); assert(isalloc(tsdn, ptr) == SC_LARGE_MINCLASS);

View File

@ -206,7 +206,6 @@ void emap_remap(tsdn_t *tsdn, emap_t *emap, edata_t *edata, szind_t szind,
bool slab) { bool slab) {
EMAP_DECLARE_RTREE_CTX; EMAP_DECLARE_RTREE_CTX;
edata_szind_set(edata, szind);
if (szind != SC_NSIZES) { if (szind != SC_NSIZES) {
rtree_szind_slab_update(tsdn, &emap->rtree, rtree_ctx, rtree_szind_slab_update(tsdn, &emap->rtree, rtree_ctx,
(uintptr_t)edata_addr_get(edata), szind, slab); (uintptr_t)edata_addr_get(edata), szind, slab);

View File

@ -487,6 +487,7 @@ extent_split_interior(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
} }
if (leadsize == 0 && trailsize == 0) { if (leadsize == 0 && trailsize == 0) {
edata_szind_set(*edata, szind);
emap_remap(tsdn, &emap_global, *edata, szind, slab); emap_remap(tsdn, &emap_global, *edata, szind, slab);
} }

View File

@ -185,6 +185,7 @@ pa_expand(tsdn_t *tsdn, pa_shard_t *shard, edata_t *edata, size_t old_size,
ATOMIC_RELAXED); ATOMIC_RELAXED);
} }
pa_nactive_add(shard, expand_amount >> LG_PAGE); pa_nactive_add(shard, expand_amount >> LG_PAGE);
edata_szind_set(edata, szind);
emap_remap(tsdn, &emap_global, edata, szind, slab); emap_remap(tsdn, &emap_global, edata, szind, slab);
return false; return false;
} }