[dm-crypt] aes-xts-plain with aes_x86_64 makes my SSD 5x slower than my encrypted HD

Milan Broz mbroz at redhat.com
Tue Jul 24 17:19:26 CEST 2012

On 07/24/2012 05:02 PM, Marc MERLIN wrote:
> On Tue, Jul 24, 2012 at 08:25:18AM +0200, Heinz Diehl wrote:
>> Please correct me if I should be wrong, but your drive should report
>> 512/4096 here, so it lies about the real blocksize it uses (4k).
>> This raises the question if you have created your filesystem on top of
>> the encrypted partition with e.g. "-b 4096".
> I'm using btrfs, which defaults to 4K blocks. Also, I was I seeing 270MB/s
> reading a big file with btrfs on top of cryptroot.
> On Tue, Jul 24, 2012 at 10:44:36AM +0200, Milan Broz wrote:
>> Seems I am running out of ideas :)
>> (I just read the mails again and I think I am missing something
>> obvious. Whatever, I will return to it later.)
> I wanted to command you for not giving up, you definitely went the extra
> mile :)


So seems elevator completely misbehaves for SSD in some situations.

I have no time to check it today but this must be fixed. Read-ahead
is just stupid workaround...

# echo "0">/sys/block/sdc/queue/rotational 
# hdparm -t /dev/mapper/sdc_null_crypt 
 Timing buffered disk reads:  220 MB in  3.01 seconds =  73.07 MB/sec

# echo "1">/sys/block/sdc/queue/rotational 
# hdparm -t /dev/mapper/sdc_null_crypt 
 Timing buffered disk reads:  652 MB in  3.01 seconds = 216.75 MB/sec

This SSD is quicker if set to rotational mode!
(So it merges requests in fact.)


More information about the dm-crypt mailing list