Don't purge huge extents when decay is off.

This commit is contained in:
Qi Wang 2020-01-13 16:18:32 -08:00 committed by Qi Wang
parent 38a48e5741
commit 0f552ed673
2 changed files with 8 additions and 1 deletions

View File

@ -103,6 +103,12 @@ arena_prof_info_set(tsd_t *tsd, edata_t *edata, prof_tctx_t *tctx) {
large_prof_info_set(edata, tctx); large_prof_info_set(edata, tctx);
} }
JEMALLOC_ALWAYS_INLINE bool
arena_may_force_decay(arena_t *arena) {
return !(arena_dirty_decay_ms_get(arena) == -1
|| arena_muzzy_decay_ms_get(arena) == -1);
}
JEMALLOC_ALWAYS_INLINE void JEMALLOC_ALWAYS_INLINE void
arena_decay_ticks(tsdn_t *tsdn, arena_t *arena, unsigned nticks) { arena_decay_ticks(tsdn_t *tsdn, arena_t *arena, unsigned nticks) {
tsd_t *tsd; tsd_t *tsd;

View File

@ -1226,7 +1226,8 @@ extent_record(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks, ecache_t *ecache,
&arena->edata_cache, ehooks, rtree_ctx, ecache, &arena->edata_cache, ehooks, rtree_ctx, ecache,
edata, &coalesced, growing_retained); edata, &coalesced, growing_retained);
} while (coalesced); } while (coalesced);
if (edata_size_get(edata) >= oversize_threshold) { if (edata_size_get(edata) >= oversize_threshold &&
arena_may_force_decay(arena)) {
/* Shortcut to purge the oversize extent eagerly. */ /* Shortcut to purge the oversize extent eagerly. */
malloc_mutex_unlock(tsdn, &ecache->mtx); malloc_mutex_unlock(tsdn, &ecache->mtx);
arena_decay_extent(tsdn, arena, ehooks, edata); arena_decay_extent(tsdn, arena, ehooks, edata);