mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 13:13:06 +00:00
Add support for sharded bins within an arena.
This makes it possible to have multiple set of bins in an arena, which improves arena scalability because the bins (especially the small ones) are always the limiting factor in production workload. A bin shard is picked on allocation; each extent tracks the bin shard id for deallocation. The shard size will be determined using runtime options.
This commit is contained in:
@@ -379,6 +379,9 @@ arena_bind(tsd_t *tsd, unsigned ind, bool internal) {
|
||||
tsd_iarena_set(tsd, arena);
|
||||
} else {
|
||||
tsd_arena_set(tsd, arena);
|
||||
unsigned binshard = atomic_fetch_add_u(&arena->binshard_next, 1,
|
||||
ATOMIC_RELAXED) % BIN_SHARDS_MAX;
|
||||
tsd_binshard_set(tsd, binshard);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user