diff options
author | Jason Evans <jasone@canonware.com> | 2015-05-20 00:47:16 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2015-05-20 00:47:16 (GMT) |
commit | 836bbe9951a903b2d76af53dfb3ad53ad186f8b9 (patch) | |
tree | a22d40fc01bba7888657d7ad761c29400cd401b8 /src/tcache.c | |
parent | 6591ff09d80e11f36603a75b32dc6a9b81fb3d47 (diff) | |
download | jemalloc-836bbe9951a903b2d76af53dfb3ad53ad186f8b9.zip jemalloc-836bbe9951a903b2d76af53dfb3ad53ad186f8b9.tar.gz jemalloc-836bbe9951a903b2d76af53dfb3ad53ad186f8b9.tar.bz2 |
Impose a minimum tcache count for small size classes.
Now that small allocation runs have fewer regions due to run metadata
residing in chunk headers, an explicit minimum tcache count is needed to
make sure that tcache adequately amortizes synchronization overhead.
Diffstat (limited to 'src/tcache.c')
-rw-r--r-- | src/tcache.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tcache.c b/src/tcache.c index 83e7e36..3814365 100644 --- a/src/tcache.c +++ b/src/tcache.c @@ -515,7 +515,11 @@ tcache_boot(void) return (true); stack_nelms = 0; for (i = 0; i < NBINS; i++) { - if ((arena_bin_info[i].nregs << 1) <= TCACHE_NSLOTS_SMALL_MAX) { + if ((arena_bin_info[i].nregs << 1) <= TCACHE_NSLOTS_SMALL_MIN) { + tcache_bin_info[i].ncached_max = + TCACHE_NSLOTS_SMALL_MIN; + } else if ((arena_bin_info[i].nregs << 1) <= + TCACHE_NSLOTS_SMALL_MAX) { tcache_bin_info[i].ncached_max = (arena_bin_info[i].nregs << 1); } else { |