From b31fbab5bef3f5a18dfc7ab6a7f41ed78b5af1a8 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 --- 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 f37edc70a0f7..b25eef488a30 100644 --- a/src/compressor/zlib/ZlibCompressor.cc +++ b/src/compressor/zlib/ZlibCompressor.cc @@ -63,6 +63,14 @@ QatAccel ZlibCompressor::qat_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 c983eff39637..91c64da5b838 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