From 36195c8f4dc536f3609de539c5f26cdd44514800 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Tue, 23 May 2017 10:53:36 -0700 Subject: [PATCH] Disable percpu_arena by default. --- .travis.yml | 20 ++++++++++++++++++++ doc/jemalloc.xml.in | 4 ++-- include/jemalloc/internal/arena_types.h | 5 ----- scripts/gen_run_tests.py | 12 ++++++++++-- scripts/gen_travis.py | 6 ++++-- 5 files changed, 36 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6ca3ac44..917314fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in index 57f5b0ba..16d9ce4e 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in @@ -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 disabled, narenas and thread to arena association will - not be impacted by this option. The default is - percpu. + not be impacted by this option. The default is disabled. + diff --git a/include/jemalloc/internal/arena_types.h b/include/jemalloc/internal/arena_types.h index 34d4f6f2..1374eeca 100644 --- a/include/jemalloc/internal/arena_types.h +++ b/include/jemalloc/internal/arena_types.h @@ -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 */ diff --git a/scripts/gen_run_tests.py b/scripts/gen_run_tests.py index 9fbf71e5..875c6d03 100755 --- a/scripts/gen_run_tests.py +++ b/scripts/gen_run_tests.py @@ -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' diff --git a/scripts/gen_travis.py b/scripts/gen_travis.py index 4a4c2144..26997b25 100755 --- a/scripts/gen_travis.py +++ b/scripts/gen_travis.py @@ -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))