Disable percpu_arena by default.

This commit is contained in:
Jason Evans 2017-05-23 10:53:36 -07:00
parent 196a53c2ae
commit 36195c8f4d
5 changed files with 36 additions and 11 deletions

View File

@ -24,6 +24,8 @@ matrix:
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--with-malloc-conf=dss:primary" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--with-malloc-conf=percpu_arena:percpu" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: osx
env: CC=clang CXX=clang++ COMPILER_FLAGS="" CONFIGURE_FLAGS="" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: osx
@ -50,6 +52,8 @@ matrix:
env: CC=clang CXX=clang++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=clang CXX=clang++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--with-malloc-conf=dss:primary" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=clang CXX=clang++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--with-malloc-conf=percpu_arena:percpu" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="-m32" CONFIGURE_FLAGS="--enable-debug" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
addons:
@ -80,6 +84,12 @@ matrix:
apt:
packages:
- gcc-multilib
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="-m32" CONFIGURE_FLAGS="--with-malloc-conf=percpu_arena:percpu" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
addons:
apt:
packages:
- gcc-multilib
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-debug --enable-prof" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
@ -88,18 +98,28 @@ matrix:
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-debug --with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-debug --with-malloc-conf=dss:primary" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-debug --with-malloc-conf=percpu_arena:percpu" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-prof --disable-stats" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-prof --with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-prof --with-malloc-conf=dss:primary" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-prof --with-malloc-conf=percpu_arena:percpu" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-stats --with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-stats --with-malloc-conf=dss:primary" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-stats --with-malloc-conf=percpu_arena:percpu" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--with-malloc-conf=tcache:false,dss:primary" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--with-malloc-conf=tcache:false,percpu_arena:percpu" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
- os: linux
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--with-malloc-conf=dss:primary,percpu_arena:percpu" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
before_script:

View File

@ -952,8 +952,8 @@ mallctl("arena." STRINGIFY(MALLCTL_ARENAS_ALL) ".decay",
same CPU share one arena. Note that no runtime checking regarding the
availability of hyper threading is done at the moment. When set to
<quote>disabled</quote>, narenas and thread to arena association will
not be impacted by this option. The default is
<quote>percpu</quote>. </para></listitem>
not be impacted by this option. The default is <quote>disabled</quote>.
</para></listitem>
</varlistentry>
<varlistentry id="opt.background_thread">

View File

@ -29,12 +29,7 @@ typedef enum {
percpu_arena_mode_limit = 3
} percpu_arena_mode_t;
#ifdef JEMALLOC_PERCPU_ARENA
#define PERCPU_ARENA_MODE_DEFAULT percpu_arena
#define OPT_PERCPU_ARENA_DEFAULT "percpu"
#else
#define PERCPU_ARENA_MODE_DEFAULT percpu_arena_disabled
#define OPT_PERCPU_ARENA_DEFAULT "disabled"
#endif
#endif /* JEMALLOC_INTERNAL_ARENA_TYPES_H */

View File

@ -23,6 +23,7 @@ possible_config_opts = [
possible_malloc_conf_opts = [
'tcache:false',
'dss:primary',
'percpu_arena:percpu',
]
print 'set -e'
@ -45,13 +46,20 @@ for cc, cxx in possible_compilers:
",".join(malloc_conf_opts) if len(malloc_conf_opts) > 0
else '')
)
# Per CPU arenas are only supported on Linux.
linux_supported = ('percpu_arena:percpu' in malloc_conf_opts)
# Heap profiling and dss are not supported on OS X.
darwin_unsupported = ('--enable-prof' in config_opts or \
'dss:primary' in malloc_conf_opts)
if darwin_unsupported:
if linux_supported:
print 'if [[ "$unamestr" = "Linux" ]]; then'
elif darwin_unsupported:
print 'if [[ "$unamestr" != "Darwin" ]]; then'
print config_line
print "make clean"
print "make -j" + str(MAKE_J_VAL) + " check"
if darwin_unsupported:
if linux_supported or darwin_unsupported:
print 'fi'

View File

@ -48,6 +48,7 @@ configure_flag_unusuals = [
malloc_conf_unusuals = [
'tcache:false',
'dss:primary',
'percpu_arena:percpu',
]
all_unusuals = (
@ -77,8 +78,9 @@ for unusual_combination in unusual_combinations_to_test:
malloc_conf = [
x for x in unusual_combination if x in malloc_conf_unusuals]
# Filter out an unsupported configuration - dss on OS X.
if os == 'osx' and 'dss:primary' in malloc_conf:
# Filter out unsupported configurations on OS X.
if os == 'osx' and ('dss:primary' in malloc_conf or \
'percpu_arena:percpu' in malloc_conf):
continue
if len(malloc_conf) > 0:
configure_flags.append('--with-malloc-conf=' + ",".join(malloc_conf))