Replace arena->tcache_ql with cache_bin_array_descriptor_ql walks

Drop the duplicate arena->tcache_ql; stats merging walks the
cache_bin_array_descriptor_ql directly. Rename the protecting mutex
from tcache_ql_mtx to cache_bin_array_descriptor_ql_mtx to match. Add
an assertion in test_thread_migrate_arena that the dissociate-time
flush zeros cache_bin->tstats.nrequests.
This commit is contained in:
Slobodan Predolac 2026-05-08 10:01:00 -07:00
parent f9c84860e0
commit b92420d309
9 changed files with 122 additions and 51 deletions

View file

@ -305,16 +305,16 @@ stats_print_atexit(void) {
for (i = 0, narenas = narenas_total_get(); i < narenas; i++) {
arena_t *arena = arena_get(tsdn, i, false);
if (arena != NULL) {
tcache_slow_t *tcache_slow;
cache_bin_array_descriptor_t *desc;
malloc_mutex_lock(tsdn, &arena->tcache_ql_mtx);
ql_foreach (
tcache_slow, &arena->tcache_ql, link) {
tcache_stats_merge(
tsdn, tcache_slow->tcache, arena);
malloc_mutex_lock(tsdn, &arena->cache_bin_array_descriptor_ql_mtx);
ql_foreach (desc,
&arena->cache_bin_array_descriptor_ql,
link) {
tcache_stats_merge(tsdn, desc, arena);
}
malloc_mutex_unlock(
tsdn, &arena->tcache_ql_mtx);
tsdn, &arena->cache_bin_array_descriptor_ql_mtx);
}
}
}