]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: enable SSE-assisted CRC32 calculations in RocksDB. 13741/head
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Thu, 2 Mar 2017 06:57:33 +0000 (07:57 +0100)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Sun, 5 Mar 2017 22:38:30 +0000 (22:38 +0000)
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 <rzarzynski@mirantis.com>
src/CMakeLists.txt

index 0db585838700e4673aecbfa558957719fe9d2a7e..b0fb2d6888ecc096c237a0de7d4342e0655860a5 100644 (file)
@@ -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})