Lines Matching refs:tsdn
57 void background_thread_interval_check(tsdn_t *tsdn, arena_t *arena, in background_thread_create()
59 void background_thread_prefork0(tsdn_t *tsdn) NOT_REACHED in background_thread_create()
60 void background_thread_prefork1(tsdn_t *tsdn) NOT_REACHED in background_thread_create()
61 void background_thread_postfork_parent(tsdn_t *tsdn) NOT_REACHED in background_thread_create()
62 void background_thread_postfork_child(tsdn_t *tsdn) NOT_REACHED in background_thread_create()
63 bool background_thread_stats_read(tsdn_t *tsdn, in background_thread_create()
65 void background_thread_ctl_init(tsdn_t *tsdn) NOT_REACHED in background_thread_create()
72 background_thread_info_init(tsdn_t *tsdn, background_thread_info_t *info) {
73 background_thread_wakeup_time_set(tsdn, info, 0);
116 arena_decay_compute_purge_interval_impl(tsdn_t *tsdn, arena_decay_t *decay,
118 if (malloc_mutex_trylock(tsdn, &decay->mtx)) {
195 malloc_mutex_unlock(tsdn, &decay->mtx);
202 arena_decay_compute_purge_interval(tsdn_t *tsdn, arena_t *arena) {
204 i1 = arena_decay_compute_purge_interval_impl(tsdn, &arena->decay_dirty,
209 i2 = arena_decay_compute_purge_interval_impl(tsdn, &arena->decay_muzzy,
216 background_thread_sleep(tsdn_t *tsdn, background_thread_info_t *info,
244 background_thread_wakeup_time_set(tsdn, info,
257 background_thread_wakeup_time_set(tsdn, info,
272 background_thread_pause_check(tsdn_t *tsdn, background_thread_info_t *info) {
274 malloc_mutex_unlock(tsdn, &info->mtx);
276 malloc_mutex_lock(tsdn, &background_thread_lock);
277 malloc_mutex_unlock(tsdn, &background_thread_lock);
278 malloc_mutex_lock(tsdn, &info->mtx);
286 background_work_sleep_once(tsdn_t *tsdn, background_thread_info_t *info, unsigned ind) {
291 arena_t *arena = arena_get(tsdn, i, false);
295 arena_decay(tsdn, arena, true, false);
300 uint64_t interval = arena_decay_compute_purge_interval(tsdn,
307 background_thread_sleep(tsdn, info, min_interval);
391 tsdn_t *tsdn = tsd_tsdn(tsd);
392 malloc_mutex_unlock(tsdn, &background_thread_info[0].mtx);
398 malloc_mutex_lock(tsdn, &info->mtx);
404 malloc_mutex_unlock(tsdn, &info->mtx);
428 malloc_mutex_lock(tsdn, &background_thread_info[0].mtx);
657 background_thread_interval_check(tsdn_t *tsdn, arena_t *arena,
661 if (malloc_mutex_trylock(tsdn, &info->mtx)) {
674 if (malloc_mutex_trylock(tsdn, &decay->mtx)) {
734 malloc_mutex_unlock(tsdn, &decay->mtx);
736 malloc_mutex_unlock(tsdn, &info->mtx);
740 background_thread_prefork0(tsdn_t *tsdn) {
741 malloc_mutex_prefork(tsdn, &background_thread_lock);
746 background_thread_prefork1(tsdn_t *tsdn) {
748 malloc_mutex_prefork(tsdn, &background_thread_info[i].mtx);
753 background_thread_postfork_parent(tsdn_t *tsdn) {
755 malloc_mutex_postfork_parent(tsdn,
758 malloc_mutex_postfork_parent(tsdn, &background_thread_lock);
762 background_thread_postfork_child(tsdn_t *tsdn) {
764 malloc_mutex_postfork_child(tsdn,
767 malloc_mutex_postfork_child(tsdn, &background_thread_lock);
773 malloc_mutex_lock(tsdn, &background_thread_lock);
775 background_thread_enabled_set(tsdn, false);
778 malloc_mutex_lock(tsdn, &info->mtx);
782 background_thread_info_init(tsdn, info);
783 malloc_mutex_unlock(tsdn, &info->mtx);
785 malloc_mutex_unlock(tsdn, &background_thread_lock);
789 background_thread_stats_read(tsdn_t *tsdn, background_thread_stats_t *stats) {
791 malloc_mutex_lock(tsdn, &background_thread_lock);
793 malloc_mutex_unlock(tsdn, &background_thread_lock);
802 if (malloc_mutex_trylock(tsdn, &info->mtx)) {
813 malloc_mutex_unlock(tsdn, &info->mtx);
819 malloc_mutex_unlock(tsdn, &background_thread_lock);
868 background_thread_ctl_init(tsdn_t *tsdn) {
869 malloc_mutex_assert_not_owner(tsdn, &background_thread_lock);
895 background_thread_boot1(tsdn_t *tsdn) { in background_thread_boot1() argument
905 background_thread_enabled_set(tsdn, opt_background_thread); in background_thread_boot1()
913 background_thread_info = (background_thread_info_t *)base_alloc(tsdn, in background_thread_boot1()
931 malloc_mutex_lock(tsdn, &info->mtx); in background_thread_boot1()
933 background_thread_info_init(tsdn, info); in background_thread_boot1()
934 malloc_mutex_unlock(tsdn, &info->mtx); in background_thread_boot1()