DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Stapelberg <michael+dmcrypt@stapelberg.de>
To: Milan Broz <gmazyland@gmail.com>
Cc: dm-crypt@saout.de
Subject: Re: [dm-crypt] Encrypting with larger packet size (+some experimental patch)
Date: Mon, 25 Mar 2013 20:22:41 +0100	[thread overview]
Message-ID: <x6ppyn8eta.fsf@midna.zekjur.net> (raw)
In-Reply-To: <513CA157.3000009@gmail.com>

Hi Milan,

Milan Broz <gmazyland@gmail.com> writes:
> So 2 * performance increase? I would expect even more...
> (Maybe compare it with new cryptsetup benchmark - in fact it uses much
> larger block and it should measure almost real throughput or crypto
> engine.)
In cryptsetup benchmark I am seeing much higher numbers, but I never get
close to that in “real” tests:

# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1        44887 iterations per second
PBKDF2-sha256      34492 iterations per second
PBKDF2-sha512       8904 iterations per second
PBKDF2-ripemd160   43115 iterations per second
PBKDF2-whirlpool    6884 iterations per second
#  Algorithm | Key |  Encryption |  Decryption
     aes-cbc   128b   254.0 MiB/s   264.0 MiB/s
 serpent-cbc   128b    17.5 MiB/s    17.8 MiB/s
 twofish-cbc   128b    20.4 MiB/s    20.6 MiB/s
     aes-cbc   256b   245.0 MiB/s   242.0 MiB/s
 serpent-cbc   256b    17.5 MiB/s    18.0 MiB/s
 twofish-cbc   256b    20.4 MiB/s    20.8 MiB/s
     aes-xts   256b    21.6 MiB/s    21.8 MiB/s
 serpent-xts   256b    18.0 MiB/s    18.0 MiB/s
 twofish-xts   256b    21.0 MiB/s    20.6 MiB/s
     aes-xts   512b    17.0 MiB/s    17.1 MiB/s
 serpent-xts   512b    18.0 MiB/s    18.0 MiB/s
 twofish-xts   512b    21.0 MiB/s    20.6 MiB/s


> This looks like crash in different layer, IMHO this should happen even
> with other devices (try dm-linear).  If it is reproducible, perhaps
> report it to LKML.

How would I be able to reproduce this with dm-linear? As far as I can
tell, it doesn’t have a block size parameter?

Apparently, using a block size bigger than PAGESIZE is not possible with
Linux currently. Ted Ts'o writes that he is surprised to see the
patchset to allow that being used in the wild:
https://lkml.org/lkml/2012/3/21/493

I have compared dm-linear with the dm-crypt null cipher:

echo "0 5856626815 linear /dev/sda2 0" | dmsetup create identity
dd if=/dev/zero of=/dev/mapper/identity bs=1M count=768 oflag=direct conv=fsync
768+0 records in
768+0 records out
805306368 bytes (805 MB) copied, 4.69666 s, 171 MB/s

cryptsetup luksFormat -c null /dev/sda2
cryptsetup luksOpen /dev/sda2 sda2_crypt
dd if=/dev/zero of=/dev/mapper/sda2_crypt bs=1M count=768 oflag=direct conv=fsync
768+0 records in
768+0 records out
805306368 bytes (805 MB) copied, 9.39298 s, 85.7 MB/s

This is quite a difference and I wonder what might cause it.
Here is the same test with 4096 bytes big blocks:

echo "0 5856624640 crypt cipher_null-ecb - 0 /dev/sda2 0 2 block_size 4096" | dmsetup create sda2_crypt
dd if=/dev/zero of=/dev/mapper/sda2_crypt bs=1M count=768 oflag=direct conv=fsync
768+0 records in
768+0 records out
805306368 bytes (805 MB) copied, 6.25626 s, 129 MB/s

So, any ideas on how to further debug where the problem is, or how we
can get to approximately 170 MB/s? :-)

-- 
Best regards,
Michael

      reply	other threads:[~2013-03-25 19:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22  4:18 [dm-crypt] Encrypting with larger packet size Dinesh Garg
2013-01-22  5:42 ` Arno Wagner
2013-01-22  6:04   ` Dinesh Garg
2013-01-22  7:24     ` Milan Broz
2013-01-22  8:00       ` Dinesh Garg
2013-01-22 15:54         ` Milan Broz
2013-01-24 19:44           ` Dinesh Garg
2013-01-25 23:25             ` Arno Wagner
2013-01-28 12:00             ` [dm-crypt] Encrypting with larger packet size (+some experimental patch) Milan Broz
2013-03-05 11:53               ` Michael Stapelberg
2013-03-10 15:05                 ` Milan Broz
2013-03-25 19:22                   ` Michael Stapelberg [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=x6ppyn8eta.fsf@midna.zekjur.net \
    --to=michael+dmcrypt@stapelberg.de \
    --cc=dm-crypt@saout.de \
    --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