mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
Fix background_thread creation for the oversize_arena.
Bypassing background thread creation for the oversize_arena used to be an optimization since that arena had eager purging. However #2466 changed the purging policy for the oversize_arena -- specifically it switched to the default decay time when background_thread is enabled. This issue is noticable when the number of arenas is low: whenever the total # of arenas is <= 4 (which is the default max # of background threads), in which case the purging will be stalled since no background thread is created for the oversize_arena.
This commit is contained in:
11
src/ctl.c
11
src/ctl.c
@@ -2985,17 +2985,6 @@ arena_i_decay_ms_ctl_impl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
ret = EINVAL;
|
||||
goto label_return;
|
||||
}
|
||||
if (arena_is_huge(arena_ind) && *(ssize_t *)newp > 0) {
|
||||
/*
|
||||
* By default the huge arena purges eagerly. If it is
|
||||
* set to non-zero decay time afterwards, background
|
||||
* thread might be needed.
|
||||
*/
|
||||
if (background_thread_create(tsd, arena_ind)) {
|
||||
ret = EFAULT;
|
||||
goto label_return;
|
||||
}
|
||||
}
|
||||
|
||||
if (arena_decay_ms_set(tsd_tsdn(tsd), arena, state,
|
||||
*(ssize_t *)newp)) {
|
||||
|
||||
Reference in New Issue
Block a user