Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1546234

Re: dm-crypt optimization

From Herbert Xu <herbert@gondor.apana.org.au>
Newsgroups linux.kernel
Subject Re: dm-crypt optimization
Date 2016-12-22 10:10 +0100
Message-ID <sR7xU-7u5-21@gated-at.bofh.it> (permalink)
References <sQpdv-3QC-1@gated-at.bofh.it> <sQOvg-3vJ-25@gated-at.bofh.it> <sR6Vb-6VP-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Dec 22, 2016 at 01:55:59PM +0530, Binoy Jayan wrote:
>
> > Support of bigger block sizes would be unsafe without additional mechanism that provides
> > atomic writes of multiple sectors. Maybe it applies to 4k as well on some devices though...)
> 
> Did you mean write to the crypto output buffers or the actual disk write?
> I didn't quite understand how the block size for encryption affects atomic
> writes as it is the block layer which handles them. As far as dm-crypt is,
> concerned it just encrypts/decrypts a 'struct bio' instance and submits the IO
> operation to the block layer.

I think Milan's talking about increasing the real block size, which
would obviously require the hardware to be able to write that out
atomically, as otherwise it breaks the crypto.

But if we can instead do the IV generation within the crypto API,
then the block size won't be an issue at all.  Because you can
supply as many blocks as you want and they would be processed
block-by-block.

Now there is a disadvantage to this approach, and that is you
have to wait for the whole thing to be encrypted before you can 
start doing the IO.  I'm not sure how big a problem that is but
if it is bad enough to affect performance, we can look into adding
some form of partial completion to the crypto API.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

dm-crypt optimization Binoy Jayan <binoy.jayan@linaro.org> - 2016-12-20 10:50 +0100
  Re: dm-crypt optimization Milan Broz <gmazyland@gmail.com> - 2016-12-21 13:50 +0100
    Re: dm-crypt optimization Binoy Jayan <binoy.jayan@linaro.org> - 2016-12-22 09:30 +0100
      Re: dm-crypt optimization Herbert Xu <herbert@gondor.apana.org.au> - 2016-12-22 10:10 +0100
        RE: dm-crypt optimization Ofir Drang <Ofir.Drang@arm.com> - 2016-12-22 11:20 +0100

csiph-web