mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-15 21:27:18 +03:00
Respect hpa_min_purge_interval_ms option
Currently, hugepages aware allocator backend works together with classic one as a fallback for not yet supported allocations. When background threads are enabled wake up time for classic interfere with hpa as there were no checks inside hpa purging logic to check if we are not purging too frequently. If background thread is running and `hpa_should_purge` returns true, then we will purge, even if we purged less than hpa_min_purge_interval_ms ago.
This commit is contained in:
parent
90c627edb7
commit
91a6d230db
2 changed files with 48 additions and 14 deletions
10
src/hpa.c
10
src/hpa.c
|
|
@ -378,6 +378,16 @@ static bool
|
|||
hpa_try_purge(tsdn_t *tsdn, hpa_shard_t *shard) {
|
||||
malloc_mutex_assert_owner(tsdn, &shard->mtx);
|
||||
|
||||
/*
|
||||
* Make sure we respect purge interval setting and don't purge
|
||||
* too frequently.
|
||||
*/
|
||||
uint64_t since_last_purge_ms = shard->central->hooks.ms_since(
|
||||
&shard->last_purge);
|
||||
if (since_last_purge_ms < shard->opts.min_purge_interval_ms) {
|
||||
return false;
|
||||
}
|
||||
|
||||
hpdata_t *to_purge = psset_pick_purge(&shard->psset);
|
||||
if (to_purge == NULL) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue