Return-Path: Received: from mail.bisel.ru (mail.bisel.ru [80.93.56.210]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.saout.de (Postfix) with ESMTPS for ; Mon, 15 Nov 2010 13:45:12 +0100 (CET) Received: from vasiliev.kr-pro.ru (mx.kr-pro.ru [195.16.46.183]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bisel.ru (Postfix) with ESMTPSA id 669643AEC81 for ; Mon, 15 Nov 2010 15:36:06 +0300 (MSK) Date: Mon, 15 Nov 2010 15:36:04 +0300 From: Igor Novgorodov Message-ID: <566573504.20101115153604@novg.net> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable Subject: [dm-crypt] AES-XTS performance Reply-To: Igor Novgorodov List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de Hello! I've got a question regarding encryption performance with XTS mode in dm-crypt, which is too low for what i get. Test system: - Supermicro X8DTH-6F - 1 x 4-Core Xeon E5620 with HyperThreading & AES-NI - 12Gb RAM DDR3 Reg ECC Preparation: # mount -t tmpfs tmpfs -o size=3D4G /mnt/tmpfs # dd if=3D/dev/zero of=3D/mnt/tmpfs/image # losetup /dev/loop0 /mnt/tmpfs/image AES-XTS-ESSIV:SHA256 + 512bit key READ: 220 MB/s WRITE: 79.6 MB/s AES-XTS-ESSIV:SHA256 + 256bit key READ: 259 MB/s WRITE: 86.6 MB/s And with CBC mode we get reasonable read performance (for AES-NI), but writing is as almost slow as before: AES-CBC-ESSIV:SHA256 READ: 495 MB/s WRITE: 107 MB/s AES-XTS-PLAIN64 READ: 271 MB/s WRTITE: 90.2 MB/s What is the problem here? With aes-cbc-plain64 i get ~560Mb read, and another slow write ~110Mb. Is that a limitation of a benchmark with loopback devices & tmpfs? Write speed is very slow, as i want to saturate a very fast RAID array (24 x 1Tb RAID6), which can deliver up to 800Mb/sec read: # echo 3 > /proc/sys/vm/drop_caches # dd if=3D/dev/sda of=3D/dev/null bs=3D1M count=3D20480 20480+0 records in 20480+0 records out 21474836480 bytes (21 GB) copied, 27.3376 s, 786 MB/s Any suggestions? Why write speed is so low? And why with XTS i get 50% speed drop, is that normal? Thank you! P.S. In Windows with Trucrypt internal benchmark i get 1.6Gb/s AES encryption speed with AES-NI even on low-end Core i5-620.