From 68ae65f5f1cc83869c304b66aa47f0a1d684f35e Mon Sep 17 00:00:00 2001 From: Yao guotao Date: Mon, 11 Dec 2023 17:55:22 +0800 Subject: [PATCH] The compilation of ISAL compress in the current code depends on the macro HAVE_NASM_X64_AVX2. However, the macro HAVE_NASM_X64_AVX2 has been removed, resulting in the compression not using ISAL even if the compressor_zlib_isal parameter is set to true. fix: https://tracker.ceph.com/issues/63780 Signed-off-by: Yao guotao (cherry picked from commit b31fbab5bef3f5a18dfc7ab6a7f41ed78b5af1a8) --- src/compressor/zlib/ZlibCompressor.cc | 8 ++++++++ src/include/config-h.in.cmake | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/compressor/zlib/ZlibCompressor.cc b/src/compressor/zlib/ZlibCompressor.cc index fb7c1a0886cb..685b7fc43201 100644 --- a/src/compressor/zlib/ZlibCompressor.cc +++ b/src/compressor/zlib/ZlibCompressor.cc @@ -69,6 +69,14 @@ UadkAccel ZlibCompressor::uadk_accel; ZlibCompressor::ZlibCompressor(CephContext *cct, bool isal) : Compressor(COMP_ALG_ZLIB, "zlib"), isal_enabled(isal), cct(cct) { + +#if !(__x86_64__ && defined(HAVE_NASM_X64_AVX2)) || defined(__aarch64__) + if (isal_enabled) { + derr << "WARN: ISA-L enabled (compressor_zlib_isal=true) but not supported" + << dendl; + } +#endif + #ifdef HAVE_QATZIP if (cct->_conf->qat_compressor_enabled && qat_accel.init("zlib")) qat_enabled = true; diff --git a/src/include/config-h.in.cmake b/src/include/config-h.in.cmake index 48358fce936b..bc85aac22ee9 100644 --- a/src/include/config-h.in.cmake +++ b/src/include/config-h.in.cmake @@ -250,6 +250,9 @@ /* we have a recent nasm and are x86_64 */ #cmakedefine HAVE_NASM_X64 +/* nasm can also build the isa-l:avx2 */ +#cmakedefine HAVE_NASM_X64_AVX2 + /* nasm can also build the isa-l:avx512 */ #cmakedefine HAVE_NASM_X64_AVX512 -- 2.47.3