From 2d588541e5f16c57e6fe3d3d9c2f899f534c298a Mon Sep 17 00:00:00 2001 From: Kevin Cai Date: Tue, 18 Apr 2023 11:39:56 +0800 Subject: [PATCH] [BugFix] build jemalloc with 64K pagesize for arm arch (#21697) Signed-off-by: Kevin Xiaohua Cai --- thirdparty/build-thirdparty.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh index e5a7afb2566d7..a6ce89fb0d20d 100755 --- a/thirdparty/build-thirdparty.sh +++ b/thirdparty/build-thirdparty.sh @@ -955,7 +955,16 @@ build_jemalloc() { unset CFLAGS export CFLAGS="-O3 -fno-omit-frame-pointer -fPIC -g" cd $TP_SOURCE_DIR/$JEMALLOC_SOURCE - ./configure --prefix=${TP_INSTALL_DIR} --with-jemalloc-prefix=je --enable-prof --disable-cxx --disable-libdl --disable-shared + # jemalloc supports a runtime page size that's smaller or equal to the build + # time one, but aborts on a larger one. If not defined, it falls back to the + # the build system's _SC_PAGESIZE, which in many architectures can vary. Set + # this to 64K (2^16) for arm architecture, and default 4K on x86 for performance. + local addition_opts=" --with-lg-page=12" + if [[ $MACHINE_TYPE == "aarch64" ]] ; then + # change to 64K for arm architecture + addition_opts=" --with-lg-page=16" + fi + ./configure --prefix=${TP_INSTALL_DIR} --with-jemalloc-prefix=je --enable-prof --disable-cxx --disable-libdl --disable-shared $addition_opts make -j$PARALLEL make install mv $TP_INSTALL_DIR/lib/libjemalloc.a $TP_INSTALL_DIR/lib/libjemalloc_for_starrocks.a