[MDEV-22669] InnoDB lacks CRC-32C acceleration on IA-32 Created: 2020-05-22  Updated: 2020-10-07  Resolved: 2020-05-23

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Storage Engine - XtraDB
Affects Version/s: 10.0, 10.1, 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.5.4

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: performance, upstream

Issue Links:
Problem/Incident
causes MDEV-23618 InnoDB lacks IA-32 non-PIC CRC-32C ac... Closed
Relates
relates to MDEV-23900 x86_32 fail to build on innodb crc32q Closed
relates to MDEV-22641 Provide SIMD optimized wrapper for zl... Closed

 Description   

MySQL 5.6 introduced innodb_checksum_algorithm=crc32 and implemented it for AMD64 using the SSE 4.2 instructions (incorrectly advertised as "SSE2" in a startup message). It was not implemented on IA-32 or on Windows.

Since MariaDB 10.2.11, MariaDB makes use of the SSE4.2 CRC-32C instructions on Windows on both IA-32 and AMD64.

Let us be consistent and implement CRC-32C for IA-32 on all available platforms.



 Comments   
Comment by Marko Mäkelä [ 2020-05-23 ]

While evaluating the results, I noticed that on buildbot.askmonty.org, all AMD64/IA-32 platforms except Windows fail to enable the optimization:

10.2 6462af1c2e2cddf3a96818dc7884e187d8ba7f24

2020-05-22 11:40:51 140344182650752 [Note] InnoDB: Using generic crc32 instructions

The above log is from 10.2, where the CPUID check is present for AMD64.

I also downloaded a kvm-deb-xenial-x86 package of mariadb-server-core-10.5_10.5.4+maria~xenial_i386.deb with my change, and checked the generated code. The CPUID instruction is present, and the code around it looks correct to me.

On buildbot.mariadb.org (which uses Docker images rather than virtual machines), we do see the expected message:

10.5 51f0fa4eb375334857f9e03b5262e9cda57f92d2

2020-05-22 22:11:41 0 [Note] InnoDB: Using SSE4.2 crc32 instructions

Generated at Thu Feb 08 09:16:33 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.