Add batching to arena bins.

This adds a fast-path for threads freeing a small number of allocations to
bins which are not their "home-base" and which encounter lock contention in
attempting to do so. In producer-consumer workflows, such small lock hold times
can cause lock convoying that greatly increases overall bin mutex contention.
This commit is contained in:
David Goldblatt
2024-02-09 16:08:45 -08:00
committed by David Goldblatt
parent 44d91cf243
commit fc615739cb
16 changed files with 722 additions and 78 deletions

View File

@@ -1334,6 +1334,11 @@ malloc_conf_init_helper(sc_data_t *sc_data, unsigned bin_shard_sizes[SC_NBINS],
BIN_REMOTE_FREE_ELEMS_MAX,
CONF_DONT_CHECK_MIN, CONF_CHECK_MAX,
/* clip */ true)
CONF_HANDLE_SIZE_T(opt_bin_info_remote_free_max,
"remote_free_max", 0,
BIN_REMOTE_FREE_ELEMS_MAX,
CONF_DONT_CHECK_MIN, CONF_CHECK_MAX,
/* clip */ true)
if (CONF_MATCH("tcache_ncached_max")) {
bool err = tcache_bin_info_default_init(