mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 05:33:06 +00:00
Avoid creating bg thds for huge arena lone.
For low arena count settings, the huge threshold feature may trigger an unwanted bg thd creation. Given that the huge arena does eager purging by default, bypass bg thd creation when initializing the huge arena.
This commit is contained in:
11
src/ctl.c
11
src/ctl.c
@@ -2276,6 +2276,17 @@ 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 (dirty ? arena_dirty_decay_ms_set(tsd_tsdn(tsd), arena,
|
||||
*(ssize_t *)newp) : arena_muzzy_decay_ms_set(tsd_tsdn(tsd),
|
||||
arena, *(ssize_t *)newp)) {
|
||||
|
||||
Reference in New Issue
Block a user