[MDEV-16859] MyRocks: support CRC32 instructions Created: 2018-07-30  Updated: 2018-10-03  Resolved: 2018-08-15

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - RocksDB
Affects Version/s: 10.2, 10.3
Fix Version/s: 10.2.18, 10.3.10

Type: Bug Priority: Major
Reporter: Sergei Petrunia Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
PartOf
includes MDEV-16860 MyRocks: support CRC32 instructions o... Closed
Relates
relates to MDEV-17280 support fast CRC for MyRocks Closed

 Description   

MyRocks is compiled without CRC32 command support. This negatively affects performance.

It is compiled without CRC32 on all packages (including Windows, .deb packages, etc...)

One can check this by starting the plugin and looking into $datadir/#rocksdb/LOG. It will have something like:

Fast CRC32 supported: Not supported on x86



 Comments   
Comment by Sergei Petrunia [ 2018-07-30 ]

It is not compiled in, because our build process does not define HAVE_SSE42, while rocksdb/util/crc32c.cc needs it to be defined:

static bool isSSE42() {
#ifndef HAVE_SSE42
  return false;
#elif defined(__GNUC__) && defined(__x86_64__) && !defined(IOS_CROSS_COMPILE)
  uint32_t c_;
  __asm__("cpuid" : "=c"(c_) : "a"(1) : "ebx", "edx");
  return c_ & (1U << 20);  // copied from CpuId.h in Folly. Test SSE42
#elif defined(_WIN64)
  int info[4];
  __cpuidex(info, 0x00000001, 0);
  return (info[2] & ((int)1 << 20)) != 0;
#else
  return false;
#endif
}

Comment by Sergei Petrunia [ 2018-07-30 ]

Another thing that file has is:

#ifdef HAVE_SSE42
#include <nmmintrin.h>
#include <wmmintrin.h>
#endif

These files are not present on a default Linux install, so at least for .deb packaging we will need to figure out which package has them, and put it to build-deps.

Generated at Thu Feb 08 08:32:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.