Cryptsetup development
 help / color / mirror / Atom feed
From: dE <de.techno@gmail.com>
To: Milan Broz <gmazyland@gmail.com>
Cc: cryptsetup@lists.linux.dev
Subject: Re: Decrypting only uses 2 threads.
Date: Wed, 17 Apr 2024 12:48:28 +0530	[thread overview]
Message-ID: <CADofXPC=3A-bvm8vvcQT2Cw2CT7z+OBRZySY0ASVUSd=DouVuQ@mail.gmail.com> (raw)
In-Reply-To: <df0db981-48df-4c7a-99ea-f8178c1180f2@gmail.com>

Ok, thanks. ctr is only used for testing since it's sureshot parallel.

On Mon, Apr 15, 2024 at 3:14 PM Milan Broz <gmazyland@gmail.com> wrote:
>
> On 4/15/24 10:49 AM, dE wrote:
> > Hi.
> >      I'm trying to encrypt some block devices and trying to use a
> > cipher and mode which is multithreaded. I'm trying out
> > aes-ctr-essiv:sha256 to test multithreading, but have also tried
> > aes-xts-essiv:sha256 with the same result.
> >
> > The encryption is definitely multithread (massively), but while
> > reading from the encrypted block device, I see that only 2 threads are
> > being used. As a result when the CPU is throttled (deliberately), I
> > see a drop in throughput while increased CPU utilization only in 2
> > cores.
>
> I think dm-crypt will not switch decryption from different core when coming
> from block layer here (if you have multiple threads/processes reading
> from dm-crypt device, I think it will be parallelized as expected).
> Maybe setting different scheduler helps.
>
> Anyway, this is question for kernel, better ask on dm-devel list and
> always mention kernel version here.
>
> > The following commands were used to setup the encryption --
> >
> > cryptsetup -y -d - -c aes-ctr-essiv:sha256 --key-size 256 create disk1 /dev/sda
>
> Never use CTR mode for FDE this way, it is insecure as the only tweak is fixed
> (CTR requires nonce while sector number is reused).
>
> Milan

      reply	other threads:[~2024-04-17  7:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15  8:49 Decrypting only uses 2 threads dE
2024-04-15  9:44 ` Milan Broz
2024-04-17  7:18   ` dE [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADofXPC=3A-bvm8vvcQT2Cw2CT7z+OBRZySY0ASVUSd=DouVuQ@mail.gmail.com' \
    --to=de.techno@gmail.com \
    --cc=cryptsetup@lists.linux.dev \
    --cc=gmazyland@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).