mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-28 19:33:04 +03:00
Remove opt_background_thread_hpa_interval_max_ms
Now that HPA can communicate the time until its deferred work should be done, this option is not used anymore.
This commit is contained in:
parent
8229cc77c5
commit
6e848a005e
8 changed files with 34 additions and 64 deletions
31
src/pac.c
31
src/pac.c
|
|
@ -208,9 +208,38 @@ pac_dalloc_impl(tsdn_t *tsdn, pai_t *self, edata_t *edata,
|
|||
*deferred_work_generated = true;
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
pac_ns_until_purge(tsdn_t *tsdn, decay_t *decay, size_t npages) {
|
||||
if (malloc_mutex_trylock(tsdn, &decay->mtx)) {
|
||||
/* Use minimal interval if decay is contended. */
|
||||
return BACKGROUND_THREAD_DEFERRED_MIN;
|
||||
}
|
||||
uint64_t result = decay_ns_until_purge(decay, npages,
|
||||
ARENA_DEFERRED_PURGE_NPAGES_THRESHOLD);
|
||||
|
||||
malloc_mutex_unlock(tsdn, &decay->mtx);
|
||||
return result;
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
pac_time_until_deferred_work(tsdn_t *tsdn, pai_t *self) {
|
||||
return BACKGROUND_THREAD_DEFERRED_MAX;
|
||||
uint64_t time;
|
||||
pac_t *pac = (pac_t *)self;
|
||||
|
||||
time = pac_ns_until_purge(tsdn,
|
||||
&pac->decay_dirty,
|
||||
ecache_npages_get(&pac->ecache_dirty));
|
||||
if (time == BACKGROUND_THREAD_DEFERRED_MIN) {
|
||||
return time;
|
||||
}
|
||||
|
||||
uint64_t muzzy = pac_ns_until_purge(tsdn,
|
||||
&pac->decay_muzzy,
|
||||
ecache_npages_get(&pac->ecache_muzzy));
|
||||
if (muzzy < time) {
|
||||
time = muzzy;
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue