mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-26 00:53:34 +03: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:
parent
b6f1f2669a
commit
bbe8e6a909
5 changed files with 43 additions and 15 deletions
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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue