]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common: Leverage a better CRC32C implementation 59389/head
authorTyler Stachecki <tstachecki@bloomberg.net>
Sun, 5 May 2024 14:37:34 +0000 (10:37 -0400)
committerJoseph Mundackal <jmundackal@bloomberg.net>
Wed, 21 Aug 2024 21:08:56 +0000 (17:08 -0400)
commit47961ecb5dad04db13edcfcef9ca1d63f75649b0
treec4605d3558aeeaa1ec38a485b39562efbbcab8ac
parentfe0f1a54b2262aabff59597f61ceb2581b666ea0
common: Leverage a better CRC32C implementation

ISA-L provides a few different CRC32C implementations, of
which Ceph has only ever linked against one
(crc32_iscsi_00).

The second implementation of CRC32C provided by ISA-L
(crc32_iscsi_01) improves upon the first as it is used by
Ceph in a couple of ways:

  1) crc32_iscsi_01 explicitly handles and checks for < 8
     byte buffers and computes the CRC32C value using the
     hardware-accelerated CRC32 instruction. In comparison,
     crc32_iscsi_00 prefetches too far in cases of small
     buffers, requiring the Ceph code to explicitly check
     and handle this case differently in software. This
     software-fallback implementation of CRC32 also comes
     with a different set of LUTs (look up tables) and is
     less efficient as it does not make use of the CRC32
     instruction.

  2) crc32_iscsi_00 makes use of large LUTs (look up
     tables) to effectively perform the modular reduction
     required to produce the CRC32C value. In constrast,
     crc32_iscsi_01 uses the PCLMUL instruction set to
     perform reductions 128-bits at a time with smaller
     LUTs, resulting in greater throughput and less data
     cache pollution.

Fixes: https://tracker.ceph.com/issues/65791
Signed-off-by: Tyler Stachecki <tstachecki@bloomberg.net>
(cherry picked from commit 948392a41511f5a04b13a8bad43ddb6d2731a197)
src/common/CMakeLists.txt
src/common/crc32c.cc
src/common/crc32c_intel_fast.c
src/common/crc32c_intel_fast.h