[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#722898: marked as done (partman-crypto: Make "Erasing data" step optional. blockdev-wipe is too slow.)



Your message dated Wed, 30 Oct 2013 21:22:06 +0000
with message-id <E1VbdDK-0005X9-6b@franck.debian.org>
and subject line Bug#722898: fixed in partman-crypto 64
has caused the Debian Bug report #722898,
regarding partman-crypto: Make "Erasing data" step optional. blockdev-wipe is too slow.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
722898: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=722898
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: partman-crypto
Severity: normal
Tags: d-i, patch

Hello,

I'm currently in the process of installing wheezy and after 15 hours of
blockdev-wipe, the progress indicator is at 11%.  This means that the expected
time for the wipe to complete would be 5.5 days when extrapolating linearly
(which is optimistic due to decreasing disk performance towards higher block
numbers).  The device that is being wiped is a md raid 1 of two 3TB disks.
This means that I'm averaging 6 MB/s on two brand new disks and an Athlon II
X4 640 processor.  This is at least a factor 10 too slow.

As far as I can see, several things conspire to achieve this extraordinary
slowdown:
* blockdev-wipe is writing with a block size of 64k
* blockdev-wipe opens the device with O_SYNC (cf. bug #381135)
* md is running a resync in the background

Changing the block size to 4M increases throughput to 48 MB/s and disabling md
resync brings throughput up to 60 MB/s.

I still have to benchmark different block sizes, but before I get to that, I
suggest to disable md resync.  More specifically, I suggest to set to zero
/proc/sys/dev/raid/speed_limit_min, which controls the minimum resync rate.
That way, resync will yield unconditionally to any other I/O.

I'm attaching a patch (untested!) to set speed_limit_min to zero only for the
duration of wiping, however I wonder whether it might be more desireable to do
this in a different place and to keep speed_limit_min at zero during all of
the installation.  That would certainly speed up package installation on md
raid installs.

What do you think?

Cheers,
Thiemo
diff --git a/lib/crypto-base.sh b/lib/crypto-base.sh
index ba90169..c95fbab 100644
--- a/lib/crypto-base.sh
+++ b/lib/crypto-base.sh
@@ -281,10 +281,13 @@ setup_cryptdev () {
 }
 
 crypto_do_wipe () {
-	local template dev fifo pid x
+	local template dev fifo pid x speedlimit speedlimitfile
 	template=$1
 	dev=$2
 	fifo=/var/run/wipe_progress
+        speedlimitfile=/proc/sys/dev/raid/speed_limit_min
+        speedlimit=$(cat $speedlimitfile)
+        echo 0 > $speedlimitfile
 
 	mknod $fifo p
 	/bin/blockdev-wipe -s 65536 $dev > $fifo &
@@ -309,6 +312,7 @@ crypto_do_wipe () {
 	ret=$?
 
 	[ $cancelled -eq 1 ] && ret=0
+        echo $speedlimit > $speedlimitfile
 	return $ret
 }
 

--- End Message ---
--- Begin Message ---
Source: partman-crypto
Source-Version: 64

We believe that the bug you reported is fixed in the latest version of
partman-crypto, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 722898@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Christian Perrier <bubulle@debian.org> (supplier of updated partman-crypto package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Wed, 30 Oct 2013 20:24:43 +0100
Source: partman-crypto
Binary: partman-crypto partman-crypto-dm
Architecture: source i386 all
Version: 64
Distribution: unstable
Urgency: low
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Christian Perrier <bubulle@debian.org>
Description: 
 partman-crypto - Add to partman support for block device encryption (udeb)
 partman-crypto-dm - Add to partman support for dm-crypt encryption (udeb)
Closes: 722898
Changes: 
 partman-crypto (64) unstable; urgency=low
 .
   [ Thiemo Nagel ]
   * Make "Erasing data" step optional. blockdev-wipe is too slow
     Closes: #722898
   * blockdev-wipe: Set blocksize to 512k
   * blockdev-wipe: Sync at most once per second
   * blockdev-wipe: Allocate buffer from heap instead of stack
   * blockdev-wipe: Reduce progress indicator granularity to 1/1000
 .
   [ Updated translations ]
   * Polish (pl.po) by Michał Kułach
Checksums-Sha1: 
 eb952c5daf25814be5aefa4a37e97c195d63acfb 1782 partman-crypto_64.dsc
 6df86ef612ce50ad39e00542d82e046e0f9d916d 336395 partman-crypto_64.tar.gz
 4ce51c43c5a268ce468d86fb695ecfa223e5806f 294134 partman-crypto_64_i386.udeb
 46d29e4698046e7f6ff1fb9af3d80ecc6f7f3887 1328 partman-crypto-dm_64_all.udeb
Checksums-Sha256: 
 3c99a501ae9e591545251d0975702216be65976a5e70981442dc1047c24edca6 1782 partman-crypto_64.dsc
 e74474850fbb4e416236aa76819c4d59cb3a7464d2bd4c6212e78e49027c78f0 336395 partman-crypto_64.tar.gz
 6a8f917fbf871aee131b5cc41d92f7aaf822625f04334f4409d05ebb322577a2 294134 partman-crypto_64_i386.udeb
 27eafc8f57e932fcd7b611c61c234b4126f704c6f62288794ac338c004ba37ea 1328 partman-crypto-dm_64_all.udeb
Files: 
 318159afcd71ff005e57be5d1a8b3d45 1782 debian-installer optional partman-crypto_64.dsc
 a95d781a1e166a98635c1fb1c1605233 336395 debian-installer optional partman-crypto_64.tar.gz
 89a2af00e5e971165bd00ed134838410 294134 debian-installer optional partman-crypto_64_i386.udeb
 384268547b33c460a8c3159417608f8e 1328 debian-installer optional partman-crypto-dm_64_all.udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIVAwUBUnFv6IcvcCxNbiWoAQLTlhAAilYMczZqvkQbq90Ot05WW8qQpVPBGuuI
k6eqyecyx/E8pd3RDvcP5nivRUix0X9f3Dq/wMB0VMEdp4oc+VqvOhVXOP3QfJFk
vJ68XAFY2Cvbn/2UOgBPUpcMHlRWpTUd0R+yJJpJ3vzB0wEGMiPueoOMua4cZXyn
y8vIAJ4ctWgJz6gEeI/j53yGuFmUNF3MxAOFSyTX3kQUXgwZtWUYoDC0g1C6pPb5
dqP6mEvspHxmFN2+O5HEBHZIZ5hoAsu9+72SDJ2dXcrRREgkkcXodd48hiDulwvJ
nu84ZSqMt7zrl8P6DA2FU0G6rUz4i9+Yz51GClTH1XoRcuEu6/uJN0WQ5S1Xy37e
h3e/SGm4BENygGw3j9BP9ivC8XrychS2h9OBcHzG02hOLZxgTAonmKtIp++JZcHc
cRvZG6vH1Sc3zVdcXt6RoGN00JMxmKmINh27iOr4AUExnRaBYA/jjp6LgrWRm5w4
CQfJ1F2QfGYV9aJI5LtlBoImU7ZBmYfWTnATfovrvR/lKTssfujFunjtGW8AKBQK
rfXmXe0gOklzMivxp/dkldholM3VA+VbAMEYBM5HB7/XoPI8gl7OXsifoyK07ajF
4tq2ZYiNtOEac8LFhzCH0zzGt7NHiluJDMGq4tOVEAUKv/u/wDU1QtnVHMPTV3CT
xndF/JXQVQk=
=edEX
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: