cryptsetup benchmark using AMD Zen 3 gen 4 CPU

Chat about Linux in general
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
Post Reply
t42
Level 11
Level 11
Posts: 3747
Joined: Mon Jan 20, 2014 6:48 pm

cryptsetup benchmark using AMD Zen 3 gen 4 CPU

Post by t42 »

Comparison of cryptsetup benchmark on different kernel versions with and without mitigations showed 35% decline. There is no sign of mitigation optimization even in 6.6 kernel. And the fastest kernel for some reason is 5.15.0-88-generic. Currently I don't have similar Intel CPU to test the same.
59.png

Code: Select all

Desktop: Cinnamon v: 5.8.4 tk: GTK v: 3.24.33 wm: muffin vt: 7 dm: LightDM
    v: 1.30.0 Distro: Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy
Machine:
  Type: Desktop System: Gigabyte product: X570 AORUS PRO v: -CF
  Mobo: Gigabyte model: X570 AORUS PRO serial: <superuser required>
CPU:
  Info: model: AMD Ryzen 5 5600G with Radeon Graphics bits: 64 type: MT MCP
    arch: Zen 3 gen: 4 level: v3
Note: data in the table are for algorithm aes-xts with 256b key. cryptsetup 2.4.3.
Last edited by xenopeek on Sat Nov 18, 2023 8:30 am, edited 1 time in total.
Reason: not a support request; moved to chat
-=t42=-
User avatar
xenopeek
Level 25
Level 25
Posts: 29615
Joined: Wed Jul 06, 2011 3:58 am

Re: cryptsetup benchmark using AMD Zen 3 gen 4 CPU

Post by xenopeek »

cryptsetup benchmark is a memory based test to compare different algorithms on your CPU. No disk I/O. Is your storage read/write speed so high that you could notice the difference in daily use? The real world average read/write speed you see without using encryption.

I see similar difference on a Zen 4 CPU with kernel 6.6.1. Including 512b because that's what you'd use in the real world.

Code: Select all

Encryption   | mitigations off | mitigations on | difference
-------------+-----------------+----------------+------------
aes-xts 256b |      6791 MiB/s |     4508 MiB/s |     -33.6%
aes-xts 512b |      5622 MiB/s |     4174 MiB/s |     -25.8%

Decryption   | mitigations off | mitigations on | difference
-------------+-----------------+----------------+------------
aes-xts 256b |      6701 MiB/s |     4484 MiB/s |     -33.1%
aes-xts 512b |      5552 MiB/s |     4111 MiB/s |     -26.0%
The impact is a little less bad with 512b, but yeah the latest CPU bug mitigations hurt. Well not really bugs probably — both Intel and AMD keep getting in the dirt because they're hoping they can safely take corners at extreme speeds without placing guard rails :o I think you can selectively toggle each mitigation https://docs.kernel.org/admin-guide/ker ... eters.html so it may be possible to just toggle the latest mitigation off and leave the rest on and see much smaller impact. (lscpu also shows vulnerabilities and mitigations.)

Theoretically my SSD could read/write a bit faster than the numbers above, regardless of mitigations being on, but I don't trust the advertised "up to" read/write speeds to apply to my daily use :wink: That's probably at high queue depth which I just don't have the workload for.

In short, I'm leaving mitigations on.
Image
t42
Level 11
Level 11
Posts: 3747
Joined: Mon Jan 20, 2014 6:48 pm

Re: cryptsetup benchmark using AMD Zen 3 gen 4 CPU

Post by t42 »

Thank you for comprehensive addition. I don't see the need to switch off mitigations as well, In cases of standard workload the impact may be barely noticeable.
It may be of interest to compare the cryptsetup benchmark with SRSO related mitigation off:

Code: Select all

# spec_rstack_overflow=off
aes-xts        256b      4781.5 MiB/s      4776.4 MiB/s
aes-xts        512b      3955.1 MiB/s      3971.2 MiB/s
# all mitigations on
aes-xts        256b      3226.0 MiB/s      3230.5 MiB/s
aes-xts        512b      2942.2 MiB/s      2921.0 MiB/s
# all mitigations off
aes-xts        256b      4883.5 MiB/s      4872.3 MiB/s
aes-xts        512b      4046.6 MiB/s      4048.0 MiB/s
note:
kernel 6.5.0-4-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.10-1
cryptsetup 2.6.1
-=t42=-
Post Reply

Return to “Chat about Linux”