ChaCha AVX-512 Optimization in Linux 7.5 Yields Up to 99% Improvement on AMD Zen 5
The Linux kernel's ChaCha[1] stream cipher code has long had an AVX-512[2] optimized path, but it was written for early Intel CPUs with AVX-512 (Skylake) that lowered their clock speed under load, a effect known as down-clocking[3]. A change slated for Linux 7.5 tunes this code for current Intel and AMD AVX-512 processors, which do not have this limitation.
StrongSwan developer Martin Willi added a 16-block AVX-512 function for ChaCha in libcrypto. The earlier AVX-512VL code processed at most 8 blocks at a time in 256-bit registers to avoid down-clocking. The new code uses full 512-bit registers and is used for inputs larger than 8 blocks.
Testing on AMD Ryzen AI Max Strix Halo (Zen 5) showed an improvement of up to 99%, and the prior-generation AMD Zen 4, with its 256-bit data path, showed up to 39%. The patch is queued in Eric Biggers' libcrypto-next Git branch and is expected to be submitted for the Linux 7.5 merge window[4] at the end of the year.
Read the original phoronix.comDiscussion
Sources
-
Phoronix
ChaCha AVX-512 optimization for Linux 7.5 yields up to 99% improvement on AMD Zen 5



