Rate This Document
Findability
Accuracy
Completeness
Readability

Optimizing Kernel CRC32

Principles

The CRC32 algorithm is used to verify data accuracy in network communication and storage. During network communication, when a network packet is received, the CRC32 algorithm is used to calculate its CRC32 value and compare the value with the received CRC32 value to determine the data integrity.

The Linux kernel (4.14) contains the C language implementation of the CRC32 algorithm, but the performance is low and may become a performance bottleneck. In addition, the CRC instruction implementation in the AArch64 architecture has been incorporated into the kernel of a later version (version 5.0 or later). When the high CRC32 function call proportion in kernel mode becomes a bottleneck, you can incorporate the CRC instruction implementation to improve performance.

Figure 1 shows the high CRC32 call proportion in kernel mode.

Figure 1 Flame graph

Modification Method

For details, see Linux Kernel-Mode CRC32 Algorithm Optimization.

After the modification, recompile the kernel. For details, see OS Kernel Source Code Compilation.