disk cache is slow on average with dm-crypt

Bug #875733 reported by elatllat
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I would expect the cached read speeds to be the same as the cache is above the encryption device mapper layer.
Using dm-crypt read speeds are inconsistent averaging 380 MB/s, not using dm-crypt read speeds are consistently 1200 MB/s.
I used dd to test at least 12 times:
dd if=./test.file of=/dev/null bs=1M count=1024

lsb_release -rd:
Description: Ubuntu 10.04.3 LTS
Release: 10.04

apt-cache policy cryptsetup:
cryptsetup:
  Installed: 2:1.1.0~rc2-1ubuntu13
  Candidate: 2:1.1.0~rc2-1ubuntu13
  Version table:
 *** 2:1.1.0~rc2-1ubuntu13 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
        100 /var/lib/dpkg/status
---
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.21.
AplayDevices: Error: [Errno 2] No such file or directory
Architecture: i386
ArecordDevices: Error: [Errno 2] No such file or directory
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/by-path', '/dev/snd/controlC0', '/dev/snd/hwC0D2', '/dev/snd/pcmC0D0c', '/dev/snd/pcmC0D0p', '/dev/snd/timer'] failed with exit code 1:
CRDA: Error: [Errno 2] No such file or directory
Card0.Amixer.info: Error: [Errno 2] No such file or directory
Card0.Amixer.values: Error: [Errno 2] No such file or directory
DistroRelease: Ubuntu 10.04
HibernationDevice: RESUME=UUID=bedd48c0-3471-4c24-931d-ce224b3f746c
MachineType: Dell Inc. Dell DV051
Package: linux (not installed)
ProcCmdLine: root=UUID=bae54c1d-5f65-4a70-bff5-e9200e4ab461 ro quiet splash
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-33.72-generic-pae 2.6.32.41+drm33.18
Regression: No
RelatedPackageVersions: linux-firmware 1.34.7
Reproducible: Yes
RfKill:

Tags: lucid filesystem needs-upstream-testing
Uname: Linux 2.6.32-33-generic-pae i686
UserGroups:

WifiSyslog:

dmi.bios.date: 10/08/2005
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A03
dmi.board.name: 0JC474
dmi.board.vendor: Dell Inc.
dmi.chassis.type: 6
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvrA03:bd10/08/2005:svnDellInc.:pnDellDV051:pvr:rvnDellInc.:rn0JC474:rvr:cvnDellInc.:ct6:cvr:
dmi.product.name: Dell DV051
dmi.sys.vendor: Dell Inc.

Revision history for this message
Steve Langasek (vorlon) wrote :

Cryptsetup only handles the initial setup of the devices; any performance problems will be in the kernel driver instead. Reassigning.

affects: cryptsetup (Ubuntu) → linux (Ubuntu)
Revision history for this message
elatllat (elatllat) wrote :

kernel:
2.6.32-33-generic-pae #72-Ubuntu SMP Fri Jul 29 22:06:29 UTC 2011 i686 GNU/Linux
not sure how to get the version for whatever driver it's using.

options passed to cryptsetup:
cryptsetup -c aes-xts-plain -s 512 luksFormat /dev/volumegroup1/logicalvolume1

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 875733

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: lucid
Revision history for this message
elatllat (elatllat) wrote : AlsaDevices.txt

apport information

tags: added: apport-collected
description: updated
Revision history for this message
elatllat (elatllat) wrote : BootDmesg.txt

apport information

Revision history for this message
elatllat (elatllat) wrote : Card0.Codecs.codec.2.txt

apport information

Revision history for this message
elatllat (elatllat) wrote : CurrentDmesg.txt

apport information

Revision history for this message
elatllat (elatllat) wrote : IwConfig.txt

apport information

Revision history for this message
elatllat (elatllat) wrote : Lspci.txt

apport information

Revision history for this message
elatllat (elatllat) wrote : Lsusb.txt

apport information

Revision history for this message
elatllat (elatllat) wrote : PciMultimedia.txt

apport information

Revision history for this message
elatllat (elatllat) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
elatllat (elatllat) wrote : ProcInterrupts.txt

apport information

Revision history for this message
elatllat (elatllat) wrote : ProcModules.txt

apport information

Revision history for this message
elatllat (elatllat) wrote : UdevDb.txt

apport information

Revision history for this message
elatllat (elatllat) wrote : UdevLog.txt

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
penalvch (penalvch) wrote :

elatllat, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? If so, could you please test for this with the latest development release of Ubuntu? ISO images are available from http://cdimage.ubuntu.com/daily-live/current/ .

If it remains an issue, could you please run the following command in the development release from a Terminal (Applications->Accessories->Terminal), as it will automatically gather and attach updated debug information to this report:

apport-collect -p linux <replace-with-bug-number>

Also, could you please test the latest upstream kernel available following https://wiki.ubuntu.com/KernelMainlineBuilds ? It will allow additional upstream developers to examine the issue. Please do not test the daily folder, but the one all the way at the bottom. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested. If this bug is fixed in the mainline kernel, please add the following tags:
kernel-fixed-upstream
kernel-fixed-upstream-VERSION-NUMBER

where VERSION-NUMBER is the version number of the kernel you tested. For example:
kernel-fixed-upstream-v3.11-rc5

This can be done by clicking on the yellow circle with a black pencil icon next to the word Tags located at the bottom of the bug description. As well, please remove the tag:
needs-upstream-testing

If the mainline kernel does not fix this bug, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-VERSION-NUMBER

As well, please remove the tag:
needs-upstream-testing

Once testing of the upstream kernel is complete, please mark this bug's Status as Confirmed. Please let us know your results. Thank you for your understanding.

tags: added: bios-outdated-a04 needs-upstream-testing
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
elatllat (elatllat) wrote :

Seems to be fixed in 13.10 daily (Sun 18 Aug 2013 20:58:40 EDT)
I get about 5.6 GB/s on both cache of both encrypted and normal disks

Fresh install in VertualBox.
sudo -i
cryptsetup -c aes-xts-plain -s 512 luksFormat /dev/sdb
cryptsetup luksOpen /dev/sdb crypttest
mkfs.ext4 /dev/mapper/crypttest
mkdir /media/crypt
mount /dev/mapper/crypttest /media/crypt
dd if=/dev/urandom of=/media/crypt/test.dat bs=1M count=1024
cp /media/crypt/test.dat ~/test.dat
dd if=~/test.dat of=/dev/null bs=1M count=1024
dd if=~/test.dat of=/dev/null bs=1M count=1024
dd if=/media/crypt/test.dat of=/dev/null bs=1M count=1024
dd if=/media/crypt/test.dat of=/dev/null bs=1M count=1024

Changed in linux (Ubuntu):
status: Incomplete → Fix Released
Revision history for this message
elatllat (elatllat) wrote :

There is no "Tag" option in the UI for me so someone else will have to do that.

Linux demo-VirtualBox 3.11.0-2-generic #5-Ubuntu SMP Mon Aug 12 16:09:51 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.