mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 05:33:06 +00:00
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:
committed by
David Goldblatt
parent
44d91cf243
commit
fc615739cb
10
test/unit/bin_batching.sh
Normal file
10
test/unit/bin_batching.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This value of max_batched_size effectively requires all bins to be batched;
|
||||
# our page limits are fuzzy, but we bound slab item counts to 2**32, so we'd be
|
||||
# at multi-gigabyte minimum page sizes.
|
||||
# The reason for this sort of hacky approach is that we want to
|
||||
# allocate/deallocate PAGE/2-sized objects (to trigger the "non-empty" ->
|
||||
# "empty" and "non-empty"-> "full" transitions often, which have special
|
||||
# handling). But the value of PAGE isn't easily available in test scripts.
|
||||
export MALLOC_CONF="narenas:2,bin_shards:1-1000000000:3,max_batched_size:1000000000,remote_free_max_batch:1,remote_free_max:4"
|
||||
Reference in New Issue
Block a user