From 1dd4f4b4dce5a02a299db4c67b0e76aaae9cbc46 Mon Sep 17 00:00:00 2001 From: pingliu Date: Mon, 11 Mar 2024 12:03:02 +0800 Subject: [PATCH] enhance: jemalloc aarch64 platform use 64k pagesize. (#31114) pr: https://github.com/milvus-io/milvus/pull/29522 enhance: jemalloc aarch64 platform use 64k pagesize. Signed-off-by: ping.liu --- internal/core/thirdparty/jemalloc/CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/internal/core/thirdparty/jemalloc/CMakeLists.txt b/internal/core/thirdparty/jemalloc/CMakeLists.txt index 73d369adb1..f81edc8391 100644 --- a/internal/core/thirdparty/jemalloc/CMakeLists.txt +++ b/internal/core/thirdparty/jemalloc/CMakeLists.txt @@ -27,6 +27,13 @@ message(STATUS "Building (vendored) jemalloc from source") # installations. # find_package(jemalloc) +include(CheckSymbolExists) + +macro(detect_aarch64_target_arch) + check_symbol_exists(__aarch64__ "" __AARCH64) +endmacro() +detect_aarch64_target_arch() + set(JEMALLOC_PREFIX "${CMAKE_INSTALL_PREFIX}") set(JEMALLOC_LIB_DIR "${JEMALLOC_PREFIX}/lib") set(JEMALLOC_STATIC_LIB "${JEMALLOC_LIB_DIR}/libjemalloc_pic${CMAKE_STATIC_LIBRARY_SUFFIX}") @@ -37,10 +44,9 @@ if (CMAKE_OSX_SYSROOT) list(APPEND JEMALLOC_CONFIGURE_COMMAND "SDKROOT=${CMAKE_OSX_SYSROOT}") endif () -if (DEFINED MILVUS_JEMALLOC_LG_PAGE) - # Used for arm64 manylinux wheels in order to make the wheel work on both - # 4k and 64k page arm64 systems. - list(APPEND JEMALLOC_CONFIGURE_COMMAND "--with-lg-page=${MILVUS_JEMALLOC_LG_PAGE}") +if (DEFINED __AARCH64) + #aarch64 platform use 64k pagesize. + list(APPEND JEMALLOC_CONFIGURE_COMMAND "--with-lg-page=16") endif () list(APPEND