mirror of https://github.com/facebook/rocksdb.git
925d8252e5
Summary:
RocksDB's jemalloc no-dump allocator (`NewJemallocNodumpAllocator()`) was using a single manual arena. This arena's lock contention could be very high when thread caching is disabled for RocksDB blocks (e.g., when using `MALLOC_CONF='tcache_max:4096'` and `rocksdb_block_size=16384`).
This PR changes the jemalloc no-dump allocator to use a configurable number of manual arenas. That number is required to be a power of two so we can avoid division. The allocator shards allocation requests randomly across those manual arenas.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/11400
Test Plan:
- mysqld setup
- Branch: fb-mysql-8.0.28 (
|
||
---|---|---|
.. | ||
allocator.h | ||
arena.cc | ||
arena.h | ||
arena_test.cc | ||
concurrent_arena.cc | ||
concurrent_arena.h | ||
jemalloc_nodump_allocator.cc | ||
jemalloc_nodump_allocator.h | ||
memkind_kmem_allocator.cc | ||
memkind_kmem_allocator.h | ||
memory_allocator.cc | ||
memory_allocator.h | ||
memory_allocator_test.cc | ||
memory_usage.h |