All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: Yves-Alexis Perez <corsac@debian.org>
Cc: dm-crypt@saout.de, Marc MERLIN <marc@merlins.org>
Subject: Re: [dm-crypt] aes-xts-plain with aes_x86_64 makes my SSD 5x slower than my encrypted HD
Date: Mon, 23 Jul 2012 13:37:26 +0200	[thread overview]
Message-ID: <500D3776.2000307@redhat.com> (raw)
In-Reply-To: <1343041780.26887.19.camel@scapa>

On 07/23/2012 01:09 PM, Yves-Alexis Perez wrote:
> On lun., 2012-07-23 at 12:46 +0200, Milan Broz wrote:
>> So no wonder that you get slow operation - in dd/hdparm usually only
>> one cpu is processing the request. If CPU is fast enough, no problem.
>> If not you will see slowdown. AES-NI will speed up this on that cpu
>> core,
>> but will not help run request in parallel on multi-core systems.
> 
> Then I should see slow operations too, since I'm doing exactly the same
> test. My guess is that is a kernel issue somewhere, but maybe we should
> try a common ground (say, a grml live or some fedora live) and report
> back?

Well, yes. I explained dmcrypt part, there can be other problem.
E.g. alignment (bit it _seems_ correct from mails).

Reading again, 23MB/s is really slow, so yes there must be something else.

Common distro env is nice but be sure you have proper crypto modules available.
Also do not use Fedora rawhide, it has kernel compiled with debug tools
not usable for testing.

You can try start with this:

1) (this should be not problem but better check it)
Check alignment of partitions. Is it aligned to SSD page size?
(Aligning to 1MiB is always correct ;-)
Paste fdisk -l -u /dev/sda


2) try to switch io scheduler to "noop" or "deadline"
(paste lsblk -t)

You can do it online for sda (again, check with lsblk -t):
echo "noop">/sys/block/sda/queue/scheduler

Also you can try to increase queue size.

(Hard core version is to run blktrace and check if request are not split
unnecessarily :)

3) Let's test cipher_null (no encryption just fake-copy)
(you need cryptsetup 1.4.3 for this test).

create test LUKS device with null cipher: cryptsetup luksFormat -c null

Repeat tests now - is the problem the same? (please send output).
(For dmcrypt device speed should be only slighly slower.)

please note: cipher null means no encryption, just use dmcrypt layer,
so do not use for valid data :-)

4) which aes module are you using? check lsmod, check /proc/crypto

you should use either aes-ni or optimized modules (x86_64 etc)

Milan
p.s.
sorry for removing cc on first reply, my mistake.

  reply	other threads:[~2012-07-23 11:37 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-22 19:07 [dm-crypt] aes-xts-plain with aes_x86_64 makes my SSD 5x slower than my encrypted HD Marc MERLIN
2012-07-22 19:47 ` Yves-Alexis Perez
2012-07-22 20:39   ` Marc MERLIN
2012-07-22 21:47     ` Arno Wagner
2012-07-23  6:07       ` Yves-Alexis Perez
2012-07-23  6:28       ` Marc MERLIN
2012-07-23  8:14         ` Arno Wagner
2012-07-23 10:46           ` Milan Broz
2012-07-23 11:09             ` Yves-Alexis Perez
2012-07-23 11:37               ` Milan Broz [this message]
2012-07-23 15:08                 ` André Gall
2012-07-23 17:27                 ` André Gall
2012-07-24 14:06             ` Heinz Diehl
2012-07-24 14:16               ` Milan Broz
2012-07-23 16:12           ` Marc MERLIN
2012-07-23 16:19             ` Yves-Alexis Perez
2012-07-23 17:54               ` Marc MERLIN
2012-07-23 19:26                 ` Yves-Alexis Perez
2012-07-23 17:15             ` Milan Broz
2012-07-23 17:51               ` Marc MERLIN
2012-07-23 21:31                 ` Milan Broz
2012-07-24  5:57                   ` Marc MERLIN
2012-07-24  6:25                     ` Heinz Diehl
2012-07-24 15:02                       ` Marc MERLIN
2012-07-24 15:19                         ` Milan Broz
2012-07-24 16:09                           ` Marc MERLIN
2012-07-24 13:54                     ` Milan Broz
     [not found]                       ` <500E9099.8050501@redhat.com>
2012-07-24 14:27                       ` Heinz Diehl
2012-07-24 14:58                         ` Heinz Diehl
2012-07-24 15:38                           ` Marc MERLIN
2012-07-24 16:48                             ` Heinz Diehl
2012-07-24  6:11                   ` Heinz Diehl
2012-07-22 21:55     ` Marc MERLIN
2012-07-22 20:22 ` Heinz Diehl
2012-08-12 12:49 ` Pasi Kärkkäinen
2012-08-16  7:43   ` Marc MERLIN
     [not found]     ` <502D1F96.3080905@andregall.de>
2012-08-16 17:57       ` Marc MERLIN

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=500D3776.2000307@redhat.com \
    --to=mbroz@redhat.com \
    --cc=corsac@debian.org \
    --cc=dm-crypt@saout.de \
    --cc=marc@merlins.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.