Performance issue LUKS1 vs LUKS2

Lodewyk van der Westhuizen <[email protected]> Wed, 26 Apr 2023 09:53:01 -0500
Newsgroups dev.linux.lists.cryptsetup
Message-ID <CABOqr=M+uDDXC-xG_hnxGB-7MZnWUwONizC6c=r5NCYaCz6Pxg@mail.gmail.com>
Hey All,

Sorry for the long message but figured the more detail the better... I
was hoping someone could point me in the right direction. I have
machine that runs two different operating systems + cryptsetup
versions and I am seeing big slowdown on the newer setup. Please see
details below:

Setup 1 (using LUKS1):
cryptsetup 1.7+
kernel 3.10.0

Setup 2 (using LUKS2):
cryptsetup 2.3+
kernel 4.18.0

Hardware:
CPU(s):                48
On-line CPU(s) list:   0-47
Thread(s) per core:    2
Core(s) per socket:    12
Socket(s):             2

When running cryptsetup benchmark the results are the same (but AFAIK
it only uses a single core for that).

I am using the same encryption algorithm/cipher - the only difference
is the LUKS format (using LUKS2 instead of LUKS1). On the older
machine there is good cpu utilization amongst the cores but for the
newer setup performance is roughly a 1/3 of older setup. It's as if
the other socket + cores are not being used at all.

Here is how I format/encrypt (again only difference would be luks1 vs luks2):

cryptsetup luksFormat --verbose --batch-mode --type luks2 --cipher
aes-cbc-essiv:sha256 partition

Perhaps I am just missing a flag with the new setup?

I really appreciate any help in this matter.

Thank you!

Regards,

JL