DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [dm-crypt] Performance problems
@ 2012-11-19 11:51 Joakim Reinert
  2012-11-19 20:02 ` Milan Broz
  0 siblings, 1 reply; 2+ messages in thread
From: Joakim Reinert @ 2012-11-19 11:51 UTC (permalink / raw)
  To: dm-crypt

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

i intended to use dm-crypt + LUKS to encrypt my entire file system. I
ran into the following problem: After finishing cryptsetup i noticed
by testing with dd (dd if=/dev/zero of=/dev/mapper/cryptroot) with
different blocksizes, that i had read and write speeds of roughly
50MB/s. If you consider my setup, you will agree, that this is way too
slow:

cpu:        i7-2620 (AES-NI integrated)
disk:       Crucial m4 226GB SSD
ram:       4GB DDR-3 1333Mhz (Single Channel)

Additional information:

kernel:    linux 3.6.6.1
os:         arch linux

I have loaded the module aesni_intel and verified that the refcnt
changes in /proc/crypto when i open/close the encrypted partition.

I've already harrassed everybody at #archlinux and #crypto in IRC but
nobody seems to know what the problem might be. I also installed
truecrypt and did some benchmarks which show encryption and decryption
speeds of roughly 2GB/s.

Might this have something to do with the data alignment on disk? At
least with lvm it's suggested to define dataalignment=1m on SSD's. Is
it possible to define data alignment for dm-crypt?

Another possibility that would come to mind is a bug in the kernel.

I followed this guide to set up the encryption by the way:
https://wiki.archlinux.org/index.php/Dm-crypt_with_LUKS

Hoping to hear from you soon.

Kind regards

Joakim Reinert
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQqh0yAAoJEMy9easHXAWxKCoQALOEDTnrfTRi8dNb254TDqt9
m8v5iwvZ/AcKAERp6BSHdFd+Vugu+oi/263nz6vpl7eFPXbkjaYg9YJn89Xmah/Q
sQ0Ck4Jxv2Q4NSyLr9TzFPm9m7hbU/eKByJP3MuZSI8YXBH+7F+A8YeKFdq3WGTQ
5R26n87ERibOxtBFbcktcdrVhBEo7NNdlpwAQlh5VKn2w6WKFjxqZtLvCRSCK7dq
nRHsfJVxMizQkVVhLyyoKxotqLLbeW7867faY3S9/vDfPqZtY6skgCPEpb/aZYBI
k+/9E5jKLlDLOCHG0F8SUflFH4y0gMP3OP5MsAuysCQWjgZL2qGhcq/pjQy/Oabk
LGB7CLNBHeNAABVUmxfPEBji2fAXx7ke84KNNpWRLzy4FCj2tJsqUM9remsXsvo+
efS97IME+WAZ0H4M0DJU31z/pj6Tk8fXamN1KqnvazEqf5qFL3hBlZ4pSyIQBkZs
29JgFF8sBon5Vq+j+thG3CPJRxREssf+tddm60w27+fxXxceBjePPgBolsw3e9UZ
4/ksgYiG6mOmLXO61sREd3W+hqdwhHy7cAeVrYr9dFHFu29DFgOZ7WZijNVJxnks
gZd0uagk32LYySBYpvqslNNA//T+u2mcDF9vvXm+c94DfFqxD/ffYnZFwZCkFiY0
okEEhdqVpTNzaZpAxyIa
=C6JE
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dm-crypt] Performance problems
  2012-11-19 11:51 [dm-crypt] Performance problems Joakim Reinert
@ 2012-11-19 20:02 ` Milan Broz
  0 siblings, 0 replies; 2+ messages in thread
From: Milan Broz @ 2012-11-19 20:02 UTC (permalink / raw)
  To: dm-crypt; +Cc: Joakim Reinert

On 11/19/2012 12:51 PM, Joakim Reinert wrote:
> I have loaded the module aesni_intel and verified that the refcnt
> changes in /proc/crypto when i open/close the encrypted partition.

How exactly the storage stack looks like? Using underlying partition?
please paste lsblk output and cryptsetup luksDump
(you can remove slot info and hash, algorithm and payload offset
is important here)

Try to add oflag=direct to your dd command (for write) or iflag=direct
for read.

Yes, AES-NI should provide more than necessary performance.

> I've already harrassed everybody at #archlinux and #crypto in IRC but
> nobody seems to know what the problem might be. I also installed
> truecrypt and did some benchmarks which show encryption and decryption
> speeds of roughly 2GB/s.

Truecrypt by default use dm-crypt (if not switched off in config),
but internal benchmarks measure non-kernel services.


> Might this have something to do with the data alignment on disk? At
> least with lvm it's suggested to define dataalignment=1m on SSD's. Is
> it possible to define data alignment for dm-crypt?

1MiB alignment is default for LUKS (and for LVM as well btw), depends
on version and if underlying partition is aligned.

Need info above to check.

Milan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-19 20:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-19 11:51 [dm-crypt] Performance problems Joakim Reinert
2012-11-19 20:02 ` Milan Broz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox