Re: performance and threads

Arno Wagner <[email protected]>
Newsgroups dev.linux.lists.cryptsetup
Message-ID <[email protected]>
Hi,

encryption is not actually CPU bound for AES, as modern CPUs
do AES hardware. So it may appear the CPU is idle, but its
AES hardware is not.

At these speeds, the penalty you see is probably just memory
bandwidth limitations stemming from the copy that has to be
made when encrypting or decrypting. I would say these speeds
look as expected.

Kind Regards,
Arno

P.S.: I just leaned that signing with "Regards" basically means
"You are the worst!", so I am not using that anymore:
https://www.youtube.com/watch?v=owzPL9jaSU8&t=478s



On Mon, Sep 05, 2022 at 05:52:06 CEST, Kristóf Csillag wrote:
> Dear all,
> 
> I would like to ask you if what I am seeing is normal, or it's some
> configuration problem.
> 
> Short summary: reading my encrypted is a lot slower than reading it
> raw, while the CPU is underutilized.
> 
> Detailed version:
> 
> I have a RAID1 device, consisting of two identical NVMe devices.
> On the top of the RAID device, I have LUKS encryption.
> 
> These are the read speeds:
> 
> - Raw device read: 2,3 GB/s
> - RAID device read: 2,3 GB/s
> - Reading from the encrypted device: 1,6 GB/s
> 
> As you can see, there is a pretty serious performance penalty for the
> decryption.
> The cipher running is the default aes-xts-plain64 cipher.
> This is an AMD Ryzen 9 5900X 12-Core CPU, so I'm not sure what this is.
> What is even more interesting, is that the CPU doesn't seem to be all
> that busy during the reading. as far as I can tell, I only get 4
> threads of kworker / kcryptd, and their total system load is less than
> 100% (of 1 core.)
> 
> So I'm getting the impression that even though decryption is a
> CPU-bound process, my CPU is still underutilized.
> 
> Is this interpretation correct? If yes, is this to be expected, or am
> I doing something wrong? Can dm-crypt be configured to run the
> encryption on more CPU cores, with better performance?
> 
> Thank you for your help:
> 
>     Kristof Csillag
> 
> ps. I'm on kernel 5.19

-- 
Arno Wagner,     Dr. sc. techn., Dipl. Inform.,    Email: [email protected]
GnuPG: ID: CB5D9718  FP: 12D6 C03B 1B30 33BB 13CF  B774 E35C 5FA1 CB5D 9718
----
A good decision is based on knowledge and not on numbers. -- Plato

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.