Emap: Move over deregistration functions.
This commit is contained in:
parent
6513d9d923
commit
44f5f53605
@ -67,5 +67,7 @@ void emap_register_interior(tsdn_t *tsdn, emap_t *emap, rtree_ctx_t *rtree_ctx,
|
|||||||
|
|
||||||
void emap_deregister_boundary(tsdn_t *tsdn, emap_t *emap,
|
void emap_deregister_boundary(tsdn_t *tsdn, emap_t *emap,
|
||||||
rtree_ctx_t *rtree_ctx, edata_t *edata);
|
rtree_ctx_t *rtree_ctx, edata_t *edata);
|
||||||
|
void emap_deregister_interior(tsdn_t *tsdn, emap_t *emap,
|
||||||
|
rtree_ctx_t *rtree_ctx, edata_t *edata);
|
||||||
|
|
||||||
#endif /* JEMALLOC_INTERNAL_EMAP_H */
|
#endif /* JEMALLOC_INTERNAL_EMAP_H */
|
||||||
|
11
src/emap.c
11
src/emap.c
@ -172,3 +172,14 @@ emap_deregister_boundary(tsdn_t *tsdn, emap_t *emap, rtree_ctx_t *rtree_ctx,
|
|||||||
emap_rtree_write_acquired(tsdn, emap, elm_a, elm_b, NULL, SC_NSIZES,
|
emap_rtree_write_acquired(tsdn, emap, elm_a, elm_b, NULL, SC_NSIZES,
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
emap_deregister_interior(tsdn_t *tsdn, emap_t *emap, rtree_ctx_t *rtree_ctx,
|
||||||
|
edata_t *edata) {
|
||||||
|
assert(edata_slab_get(edata));
|
||||||
|
for (size_t i = 1; i < (edata_size_get(edata) >> LG_PAGE) - 1; i++) {
|
||||||
|
rtree_clear(tsdn, &emap->rtree, rtree_ctx,
|
||||||
|
(uintptr_t)edata_base_get(edata) + (uintptr_t)(i <<
|
||||||
|
LG_PAGE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
25
src/extent.c
25
src/extent.c
@ -357,27 +357,6 @@ extent_reregister(tsdn_t *tsdn, edata_t *edata) {
|
|||||||
assert(!err);
|
assert(!err);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Removes all pointers to the given extent from the global rtree indices for
|
|
||||||
* its interior. This is relevant for slab extents, for which we need to do
|
|
||||||
* metadata lookups at places other than the head of the extent. We deregister
|
|
||||||
* on the interior, then, when an extent moves from being an active slab to an
|
|
||||||
* inactive state.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
extent_interior_deregister(tsdn_t *tsdn, rtree_ctx_t *rtree_ctx,
|
|
||||||
edata_t *edata) {
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
assert(edata_slab_get(edata));
|
|
||||||
|
|
||||||
for (i = 1; i < (edata_size_get(edata) >> LG_PAGE) - 1; i++) {
|
|
||||||
rtree_clear(tsdn, &emap_global.rtree, rtree_ctx,
|
|
||||||
(uintptr_t)edata_base_get(edata) + (uintptr_t)(i <<
|
|
||||||
LG_PAGE));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Removes all pointers to the given extent from the global rtree.
|
* Removes all pointers to the given extent from the global rtree.
|
||||||
*/
|
*/
|
||||||
@ -389,7 +368,7 @@ extent_deregister_impl(tsdn_t *tsdn, edata_t *edata, bool gdump) {
|
|||||||
emap_lock_edata(tsdn, &emap_global, edata);
|
emap_lock_edata(tsdn, &emap_global, edata);
|
||||||
emap_deregister_boundary(tsdn, &emap_global, rtree_ctx, edata);
|
emap_deregister_boundary(tsdn, &emap_global, rtree_ctx, edata);
|
||||||
if (edata_slab_get(edata)) {
|
if (edata_slab_get(edata)) {
|
||||||
extent_interior_deregister(tsdn, rtree_ctx, edata);
|
emap_deregister_interior(tsdn, &emap_global, rtree_ctx, edata);
|
||||||
edata_slab_set(edata, false);
|
edata_slab_set(edata, false);
|
||||||
}
|
}
|
||||||
emap_unlock_edata(tsdn, &emap_global, edata);
|
emap_unlock_edata(tsdn, &emap_global, edata);
|
||||||
@ -1073,7 +1052,7 @@ extent_record(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks, ecache_t *ecache,
|
|||||||
|
|
||||||
edata_szind_set(edata, SC_NSIZES);
|
edata_szind_set(edata, SC_NSIZES);
|
||||||
if (edata_slab_get(edata)) {
|
if (edata_slab_get(edata)) {
|
||||||
extent_interior_deregister(tsdn, rtree_ctx, edata);
|
emap_deregister_interior(tsdn, &emap_global, rtree_ctx, edata);
|
||||||
edata_slab_set(edata, false);
|
edata_slab_set(edata, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user