From 939c20a52907573103b4de08aab7192f3dff7948 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 2 Mar 2017 07:57:33 +0100 Subject: [PATCH] os/bluestore: enable SSE-assisted CRC32 calculations in RocksDB. By default RocksDB extensively employs CRC32. It has two paths for the checksum calculation: * rocksdb::crc32c::Slow_CRC32, * rocksdb::crc32c::Fast_CRC32. The fast path depends on a run-time discovery of CPU capabilities AND a compile-time define __SSE4_2__. Although my systems really offer SSE4.2 support, the macro was undefined resulting in poor RocksDB performance visible especially during WAL transactions. The patch (awkwardly) adds the -msse4.2 to CXXFLAGS for RocksDB. Signed-off-by: Radoslaw Zarzynski --- src/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0db585838700e..b0fb2d6888ecc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -748,6 +748,11 @@ if (NOT WITH_SYSTEM_ROCKSDB) list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}) endif(WITH_CCACHE AND CCACHE_FOUND) + # We really want to have the CRC32 calculation in RocksDB accelerated + # with SSE 4.2. For details refer to rocksdb/util/crc32c.cc. + if (HAVE_INTEL_SSE4_2) + list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_CXX_FLAGS=${SIMD_COMPILE_FLAGS}) + endif() list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_AR=${CMAKE_AR}) list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) -- 2.39.5