LUKS2 на ноутбуке. Медленно...
Привет всем!
Есть LUKS контейнер поверх LVM, который поверх SSD NVMe.
Зарядка подключена.
Простое последовательное чтение из контейнера после открытия. Это не самая плохая скорость, бывает медленнее:
# dd if=/dev/mapper/luksdec of=/dev/null bs=1M count=4096 status=progress iflag=direct
3570401280 bytes (3,6 GB, 3,3 GiB) copied, 3 s, 1,2 GB/s
4096+0 records in
4096+0 records out
4294967296 bytes (4,3 GB, 4,0 GiB) copied, 3,58959 s, 1,2 GB/s
Логический том под ним:
# dd if=/dev/mapper/990provg-luksenc of=/dev/null bs=1M count=4096 status=progress iflag=direct
3235905536 bytes (3,2 GB, 3,0 GiB) copied, 1 s, 3,2 GB/s
4096+0 records in
4096+0 records out
4294967296 bytes (4,3 GB, 4,0 GiB) copied, 1,32352 s, 3,2 GB/s
Просто сам SSD:
# dd if=/dev/disk/by-id/nvme-Samsung_SSD_990_PRO_2TB_S6Z2NJ0TB46146F of=/dev/null bs=1M count=4096 status=progress iflag=direct
3245342720 bytes (3,2 GB, 3,0 GiB) copied, 1 s, 3,2 GB/s
4096+0 records in
4096+0 records out
4294967296 bytes (4,3 GB, 4,0 GiB) copied, 1,31947 s, 3,3 GB/s
Тестирование:
# cryptsetup benchmark --cipher aes-xts
# Tests are approximate using memory only (no storage IO).
# Algorithm | Key | Encryption | Decryption
aes-xts 256b 4481,7 MiB/s 4473,6 MiB/s
Выдёргиваю зарядку.
Контейнер:
# dd if=/dev/mapper/luksdec of=/dev/null bs=1M count=4096 status=progress iflag=direct
4126146560 bytes (4,1 GB, 3,8 GiB) copied, 10 s, 413 MB/s
4096+0 records in
4096+0 records out
4294967296 bytes (4,3 GB, 4,0 GiB) copied, 10,4032 s, 413 MB/s
Да, понятно, что процессор снижает частоту без провода. Но уж что-то показания совсем жуть. Опять тестирование:
# cryptsetup benchmark --cipher aes-xts
# Tests are approximate using memory only (no storage IO).
# Algorithm | Key | Encryption | Decryption
aes-xts 256b 1172,1 MiB/s 1175,1 MiB/s
Вот такая ерунда. Всё это происходит на:
# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 48 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: AuthenticAMD
Model name: AMD Ryzen 7 5800H with Radeon Graphics
CPU family: 25
Model: 80
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
Stepping: 0
Frequency boost: enabled
CPU max MHz: 4462,5000
CPU min MHz: 1200,0000
BogoMIPS: 6387.93
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_go
od nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy sv
m extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate
ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc c
qm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists
pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm
Virtualization features:
Virtualization: AMD-V
Caches (sum of all):
L1d: 256 KiB (8 instances)
L1i: 256 KiB (8 instances)
L2: 4 MiB (8 instances)
L3: 16 MiB (1 instance)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerabilities:
Itlb multihit: Not affected
L1tf: Not affected
Mds: Not affected
Meltdown: Not affected
Mmio stale data: Not affected
Retbleed: Not affected
Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Spectre v2: Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP always-on, RSB filling, PBRSB-eIBRS Not affected
Srbds: Not affected
Tsx async abort: Not affected
# free
total used free shared buff/cache available
Mem: 32716960 5126216 23894376 252784 3696368 26892696
Swap: 16777212 0 16777212
# uname -a
Linux lsh-ubu 6.2.1-060201-generic #202302251141 SMP PREEMPT_DYNAMIC Sat Feb 25 11:49:50 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Пробовал и на более старом 5.17 - аналогично. Система в это время ничего не делала, браузер с ЛОРом, терминал, пара мессенджеров.
А все говорят, что LUKS на производительность влияет очень незначительно. Что-то у меня непохоже на «незначительно». Может надо явно какую-нибудь аппаратную поддержку включить или ещё что?
Спасибо!