Kjernen i Linux har en optimalisert implementering av CRC32C-algoritmen

For inclusion in the upcoming branch of the Linux kernel 6.13, a patch has been proposed with a redesigned implementation of the CRC32C checksum algorithm. The code for the CRC32C implementation has been reduced by about 10 times (from 4546 to 418 bytes). With the retpoline protection against Spectre-class attacks disabled, the performance gain using the new implementation reaches 11.8% on AMD Zen 2 processors, 6.4% on Intel Emerald Rapids, and 4.8% on Intel Haswell. When retpoline is enabled, the performance increase is more pronounced, reaching 66.8% on systems with Intel Emerald Rapids processors, 35.0% on Intel Haswell, and 29.5% on AMD Zen 2. retpoline enabled | 512 | 833 | 1024 | 2000 | 3173 | 4096 | ———————+——-+——-+——-+—— +——-+——-+ Intel Haswell | 35.0% | 20.7% | 17.8% | 9.7% | -0.2% | 4.4% | Intel Emerald Rapids | 66.8% | 45.2% | 36.3% | 19.3% | 0.0% | 5.4% | AMD Zen 2 | 29.5% | 17.2% | 13.5% | 8.6% | -0.5% | 2.8% | retpoline disabled: | 512 | 833 | 1024 | 2000 | 3173 | 4096 | ———————+——-+——-+——-+—— +——-+——-+ Intel Haswell | 3.3% | 4.8% | 4.5% | 0.9% | -2.9% | 0.3% | Intel Emerald Rapids | 7.5% | 6.4% | 5.2% | 2.3% | -0.0% | 0.6% | AMD Zen 2 | 11.8% | 1.4% | 0.2% | 1.3% | -0.9% | -0.2%

The initial version of CRC32C included 128 unrolled loops, resulting in quite a large code size. Since modern processors with out-of-order execution support can run commands in parallel, this optimization of loop branching became redundant and only led to excessively large code. In the new version, only 4 iterations were retained, significantly reducing the code size while speeding up the operation.

Kilde: opennet.ru

KjĂžp pĂ„litelig hosting for nettsteder med DDoS-beskyttelse, VPS VDS-servere đŸ”„ KjĂžp pĂ„litelig hosting for nettsteder med DDoS-beskyttelse, VPS VDS-servere | ProHoster