Extent: Get rid of extent-specific pre/post reentrancy calls.

These are taken care of by the ehook module; the extra increments and
decrements are safe but unnecessary.
This commit is contained in:
David Goldblatt 2019-12-03 17:43:53 -08:00 committed by David Goldblatt
parent 39fdc690a0
commit e08c581cf1

View File

@ -831,29 +831,6 @@ extent_recycle(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks, eset_t *eset,
return extent; return extent;
} }
static void
extent_hook_pre_reentrancy(tsdn_t *tsdn, arena_t *arena) {
tsd_t *tsd = tsdn_null(tsdn) ? tsd_fetch() : tsdn_tsd(tsdn);
if (arena == arena_get(tsd_tsdn(tsd), 0, false)) {
/*
* The only legitimate case of customized extent hooks for a0 is
* hooks with no allocation activities. One such example is to
* place metadata on pre-allocated resources such as huge pages.
* In that case, rely on reentrancy_level checks to catch
* infinite recursions.
*/
pre_reentrancy(tsd, NULL);
} else {
pre_reentrancy(tsd, arena);
}
}
static void
extent_hook_post_reentrancy(tsdn_t *tsdn) {
tsd_t *tsd = tsdn_null(tsdn) ? tsd_fetch() : tsdn_tsd(tsdn);
post_reentrancy(tsd);
}
/* /*
* If virtual memory is retained, create increasingly larger extents from which * If virtual memory is retained, create increasingly larger extents from which
* to split requested extents in order to limit the total number of disjoint * to split requested extents in order to limit the total number of disjoint
@ -1341,9 +1318,6 @@ extent_dalloc_wrapper(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
extent_reregister(tsdn, extent); extent_reregister(tsdn, extent);
} }
if (!ehooks_are_default(ehooks)) {
extent_hook_pre_reentrancy(tsdn, arena);
}
/* Try to decommit; purge if that fails. */ /* Try to decommit; purge if that fails. */
bool zeroed; bool zeroed;
if (!extent_committed_get(extent)) { if (!extent_committed_get(extent)) {
@ -1363,9 +1337,6 @@ extent_dalloc_wrapper(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
} else { } else {
zeroed = false; zeroed = false;
} }
if (!ehooks_are_default(ehooks)) {
extent_hook_post_reentrancy(tsdn);
}
extent_zeroed_set(extent, zeroed); extent_zeroed_set(extent, zeroed);
if (config_prof) { if (config_prof) {