DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Brian J. Murrell" <brian@interlinx.bc.ca>
To: dm-crypt@saout.de
Subject: [dm-crypt] multiple crypt devices not using multiple CPUs
Date: Sun, 16 Dec 2012 16:04:05 -0500	[thread overview]
Message-ID: <kald04$263$1@ger.gmane.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1672 bytes --]

Hi,

I guess I must be missing something.  I had understood that if one had
multiple block devices being crypted by dm-crypt, if they were being
operated on at the same time, their parallel crypto operations would
utilize different CPUs.

So I just did the following:

# lvcreate -L10G -n t1 vg
# cryptsetup --verbose --verify-passphrase luksFormat /dev/vg/t1
# cryptsetup luksOpen /dev/vg/t1 t1-use
# dd of=/dev/null if=/dev/mapper/t1-use bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 12.1207 s, 86.5 MB/s

observe (a series of) "kworker(s)" each using near 100% of a core to
carry out the crypto.  I say a series of kworkers since it appears to
almost be a "relay" of them, each handing the work of to another and
going away.  But all in all there is only every near 1 full core's worth
running.

So now...

# lvcreate -L10G -n t2 vg
# cryptsetup --verbose --verify-passphrase luksFormat /dev/vg/t2
# cryptsetup luksOpen /dev/vg/t2 t2-use
# for ((x=1; x<3; x++)); do
>     dd of=/dev/null if=/dev/mapper/t$x-use bs=1M count=1000 &
> done
[1] 7369
[2] 7370
# 1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 27.62 s, 38.0 MB/s
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 27.8015 s, 37.7 MB/s

Here I observe two kworker threads each near 50% of a core.  Clearly
they are both using the same core.  But why?  As as an aside, aggregate
throughput of the two threads is quite a bit less than a single thread.

But what I really want to understand is why crypto kworkers are not
being scheduled to different, idle cores.

Cheers,
b.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

             reply	other threads:[~2012-12-16 21:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-16 21:04 Brian J. Murrell [this message]
2012-12-16 21:25 ` [dm-crypt] multiple crypt devices not using multiple CPUs Milan Broz
2012-12-16 22:02   ` Brian J. Murrell

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='kald04$263$1@ger.gmane.org' \
    --to=brian@interlinx.bc.ca \
    --cc=dm-crypt@saout.de \
    /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