Use exponential series to size extents.

If virtual memory is retained, allocate extents such that their sizes
form an exponentially growing series.  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.

This resolves #462.
This commit is contained in:
Jason Evans 2016-11-21 23:23:03 -08:00
parent c1baa0a9b7
commit 411697adcd
3 changed files with 199 additions and 32 deletions

View file

@ -1686,6 +1686,9 @@ arena_new(tsdn_t *tsdn, unsigned ind)
arena->extent_hooks = (extent_hooks_t *)&extent_hooks_default;
if (!config_munmap)
arena->extent_grow_next = psz2ind(HUGEPAGE);
ql_new(&arena->extent_cache);
if (malloc_mutex_init(&arena->extent_cache_mtx, "arena_extent_cache",
WITNESS_RANK_ARENA_EXTENT_CACHE))