DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Karol Babioch <karol@babioch.de>
To: dm-crypt@saout.de
Subject: [dm-crypt] Reconsidering default options for cryptsetup-reencrypt
Date: Fri, 23 Nov 2012 05:12:35 +0100	[thread overview]
Message-ID: <50AEF7B3.4000807@babioch.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 2049 bytes --]

Hi,

I'm currently reencrypting my (hardware) RAID setup, which is quite big
(12 TB) in order to change the cipher from aes-xts-plain to aes-xts-plain64.

While playing around with various options, I found out that a block size
of 64 MB and the use of direct I/O results in the highest speed for me.

Now, I admit that at least the "optimal" block size depends very much on
your setup and the caches and/or buffers involved.

However I would argue that enabling direct I/O should be faster on most
systems considering that usual block devices are probably quite big - at
least compared to "normal" files and reencrypting the device is a purely
consecutive process.

Running some tests I could confirm my assumption. In my case where I've
got a hardware RAID with read ahead enabled, it makes at least a
difference of about 10%.

Is there a reason why direct I/O is not enabled by default? Maybe I'm
missing something obvious here? Personally I think that 10% can be quite
much, especially when the process takes 24 hours and more.

That said I think the bigger influence is the choice of the right block
size. By choosing the right block size I could double the speed. As
already said above I think it probably is quite hard to get this one
right automatically for each and everyone, because it depends upon
various caches involved. From a theoretical stand point it probably
should be about half the size of the smallest cache involved. I'm not
sure whether it makes any sense (or is even possible) to probe for these
things, but considering the speed enhancement of - at least in my case -
100%, there should probably be something done about it.

Now, before implementing any of this, I would like to know whether
you've got similar and/or even contradicting experiences and whether
there are specific reasons for the default values of the options
mentioned above. Maybe I'm just generalizing too much here when trying
to come up with some conclusions based on my hardware.

Best regards,
Karol Babioch


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

             reply	other threads:[~2012-11-23  4:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-23  4:12 Karol Babioch [this message]
2012-11-23  6:07 ` [dm-crypt] Reconsidering default options for cryptsetup-reencrypt Arno Wagner
2012-11-23  9:00   ` Milan Broz
2012-11-23  9:27     ` Arno Wagner
2012-11-23  9:42       ` Milan Broz
2012-11-24 17:01   ` Sven Eschenberg
2012-11-24 20:59     ` Milan Broz
2012-12-03  0:27       ` DarKRaveR
2012-11-23  8:49 ` Milan Broz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50AEF7B3.4000807@babioch.de \
    --to=karol@babioch.de \
    --cc=dm-crypt@saout.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox