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

@@ -232,6 +232,15 @@ struct arena_s {
void *extent_hooks_pun;
};
/*
* Next extent size class in a growing series to use when satisfying a
* request via the extent hooks (only if !config_munmap). 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.
*/
pszind_t extent_grow_next;
/* Cache of extent structures that were allocated via base_alloc(). */
ql_head(extent_t) extent_cache;
malloc_mutex_t extent_cache_mtx;