mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 08:33:38 +03:00
Check for background thread inactivity on extents_dalloc.
To avoid background threads sleeping forever with idle arenas, we eagerly check background threads' sleep time after extents_dalloc, and signal the thread if necessary.
This commit is contained in:
parent
2c368284d2
commit
0eae838b0d
4 changed files with 91 additions and 23 deletions
|
|
@ -367,6 +367,8 @@ arena_extents_dirty_dalloc(tsdn_t *tsdn, arena_t *arena,
|
|||
extent);
|
||||
if (arena_dirty_decay_ms_get(arena) == 0) {
|
||||
arena_decay_dirty(tsdn, arena, false, true);
|
||||
} else {
|
||||
arena_background_thread_inactivity_check(tsdn, arena);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -919,6 +921,8 @@ arena_decay_stashed(tsdn_t *tsdn, arena_t *arena,
|
|||
extent_size_get(extent))) {
|
||||
extents_dalloc(tsdn, arena, r_extent_hooks,
|
||||
&arena->extents_muzzy, extent);
|
||||
arena_background_thread_inactivity_check(tsdn,
|
||||
arena);
|
||||
break;
|
||||
}
|
||||
/* Fall through. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue