From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.saout.de ([127.0.0.1]) by localhost (mail.saout.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u1aAuy09THJc for ; Tue, 24 Jul 2012 17:38:08 +0200 (CEST) Received: from mail1.merlins.org (magic.merlins.org [209.81.13.136]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.saout.de (Postfix) with ESMTPS for ; Tue, 24 Jul 2012 17:38:08 +0200 (CEST) Date: Tue, 24 Jul 2012 08:38:06 -0700 From: Marc MERLIN Message-ID: <20120724153806.GB14273@merlins.org> References: <20120723062850.GA6931@merlins.org> <20120723081407.GA872@tansi.org> <20120723161242.GB27727@merlins.org> <500D86AC.7090100@redhat.com> <20120723175129.GA15867@merlins.org> <500DC2B0.8060409@redhat.com> <20120724055722.GA15507@merlins.org> <500EA8FE.3010303@redhat.com> <20120724142753.GA21730@fancy-poultry.org> <20120724145817.GC21730@fancy-poultry.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120724145817.GC21730@fancy-poultry.org> Subject: Re: [dm-crypt] aes-xts-plain with aes_x86_64 makes my SSD 5x slower than my encrypted HD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Milan Broz , dm-crypt@saout.de On Tue, Jul 24, 2012 at 04:58:17PM +0200, Heinz Diehl wrote: > On 24.07.2012, Heinz Diehl wrote: > > [....] > > And that's obviously not all. The problem occurs also with _unencrypted_ > partitions/devices, here's the proof (/dev/sda1 is a 500M ext2 > partition mounted on /boot; using the same Hitachi rotational drive as > in my previous test): > > [root@wildsau /]# blockdev --setra 8192 /dev/sda1 > [root@wildsau /]# hdparm -t /dev/sda1 > Timing buffered disk reads: 236 MB in 3.00 seconds = 78.57 MB/sec Funny you'd say that. I checked mine (with 3.4.4) By default, it comes with: gandalfthegreat:~# blockdev --report /dev/sda2 RO RA SSZ BSZ StartSec Size Device rw 256 512 4096 502272 26843283456 /dev/sda2 gandalfthegreat:~# blockdev --setra 0 /dev/sda2 gandalfthegreat:~# hdparm -t /dev/sda2 /dev/sda2: Timing buffered disk reads: 2 MB in 4.81 seconds = 425.77 kB/sec gandalfthegreat:~# hdparm --direct -t /dev/sda2 /dev/sda2: Timing O_DIRECT disk reads: 432 MB in 3.01 seconds = 143.68 MB/sec So I know it doens't make sense, but apparently it's SSD/machine sensitive and for me the default of 256 is enough for the block device, but not enough for a dm-crypt'ed device. I just checked that my other dmcrypt device I just created: gandalfthegreat:~# blockdev --report /dev/mapper/test RO RA SSZ BSZ StartSec Size Device rw 256 512 4096 0 26839089152 /dev/mapper/test So I do get 256 RA consistently and it's enough for the raw block device, but not enough for a dm-crypted device. gandalfthegreat:~# hdparm -t /dev/mapper/test /dev/mapper/test: Timing buffered disk reads: 66 MB in 3.05 seconds = 21.62 MB/sec By the way, just for run, I tried cryptsetup luksFormat --align-payload=8192 -c twofish-xts-plain64 /dev/sda2 instead of cryptsetup luksFormat --align-payload=8192 -c aes-xts-plain /dev/sda2 since it was suggested that it might be faster on recent laptops. Well, on a Lenovo 530 with model name : Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz I get 177 MB/s for twofish-xts-plain64 and 281 MB/s for aes-xts-plain For comparison, I got 406 MB/s for null dmcrypt. So it sounds like for my SSD, aes-xts-plain is the fastest with aesni_intel once I've run blockdev --settra 8192. I tried --settra 81920 (10x more) and it raised aes-xts-plain from 281MB/s to 298MB/s and null dmcrypt 406MB/s to 446MB/s. Hope this helps. Marc -- "A mouse is a device used to point at the xterm you want to type in" - A.S.R. Microsoft is to operating systems .... .... what McDonalds is to gourmet cooking Home page: http://marc.merlins.org/