From: Yao guotao Date: Mon, 11 Dec 2023 09:55:22 +0000 (+0800) Subject: The compilation of ISAL compress in the current code depends on the macro HAVE_NASM_X... X-Git-Tag: v20.1.1~56^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=68ae65f5f1cc83869c304b66aa47f0a1d684f35e;p=ceph.git 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) --- diff --git a/src/compressor/zlib/ZlibCompressor.cc b/src/compressor/zlib/ZlibCompressor.cc index fb7c1a0886c..685b7fc4320 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 48358fce936..bc85aac22ee 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