All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: device-mapper development <dm-devel@redhat.com>,
	Mark Brown <broonie@kernel.org>, Milan Broz <gmazyland@gmail.com>,
	Jens Axboe <axboe@kernel.dk>,
	keith.busch@intel.com, linux-raid@vger.kernel.org,
	martin.petersen@oracle.com, Mike Snitzer <snitzer@redhat.com>,
	Baolin Wang <baolin.wang@linaro.org>,
	linux-block@vger.kernel.org, neilb@suse.com,
	LKML <linux-kernel@vger.kernel.org>,
	sagig@mellanox.com, tj@kernel.org, dan.j.williams@intel.com,
	Kent Overstreet <kent.overstreet@gmail.com>,
	Alasdair G Kergon <agk@redhat.com>
Subject: Re: [dm-devel] [PATCH v2 0/2] Introduce the bulk IV mode for improving the crypto engine efficiency
Date: Wed, 13 Jan 2016 11:17:04 +0100	[thread overview]
Message-ID: <49336038.lhIkHu2mkF@wuerfel> (raw)
In-Reply-To: <alpine.LRH.2.02.1601122113240.24452@file01.intranet.prod.int.rdu2.redhat.com>

On Tuesday 12 January 2016 21:18:12 Mikulas Patocka wrote:
> On Wed, 13 Jan 2016, Arnd Bergmann wrote:
> 
> > On Tuesday 12 January 2016 18:31:19 Mikulas Patocka wrote:
> > > 
> > > Another possibility is to use dm-crypt block size 4k and use a filesystem 
> > > with 4k blocksize on it (it will never send requests not aligned on 4k 
> > > boundary, so we could reject such requests with an error).
> > 
> > Is there ever a reason to use something other than 4K block size on
> > dm-crypt?
> > 
> >       Arnd
> 
> You can't use 4k block on CBC (and most other encryption modes). If only a 
> part of 4k block is written (and then system crash happens), CBC would 
> corrupt the block completely.
> 
> For example, suppose that EXT2 directory block is updated, the first 
> 512-byte sector is written and the rest of the sectors is not written 
> because of a crash. CBC would corrupt all sectors except the first one in 
> this case.
> 
> You could use 4k block on XTS and ECB.

Ah, I did not know that ext2 was doing sub-block writes. This may be
something to address in the ext4 code (and other file systems), as
a lot of flash storage devices (SD cards and eMMC) get really slow
when you do writes smaller than 4K because of the internal
read-modify-write cycle. Ideally you want to always drive those
using 64K writes (for reads, it doesn't matter much).

For hard drives, there are still a couple of older models that have
native 512 byte sectors, but the majority of new drivers also
prefers 4K writes. SSDs are typically optimized for 4K writes because
that is what they expect software to do, but they use larger writes
internally.

	Arnd

  reply	other threads:[~2016-01-13 10:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16  3:18 [PATCH v2 0/2] Introduce the bulk IV mode for improving the crypto engine efficiency Baolin Wang
2015-12-16  3:18 ` Baolin Wang
2015-12-16  3:18 ` [PATCH v2 1/2] block: Export the __blk_bios_map_sg() to map one bio Baolin Wang
2015-12-16  3:18 ` [PATCH v2 2/2] md: dm-crypt: Introduce the bulk IV mode for bulk crypto Baolin Wang
2015-12-16  8:08 ` [PATCH v2 0/2] Introduce the bulk IV mode for improving the crypto engine efficiency Milan Broz
2015-12-16  8:31   ` Baolin Wang
2015-12-17  7:37   ` Baolin Wang
2016-01-02 22:46     ` Milan Broz
2016-01-04  6:58       ` Baolin Wang
2016-01-04 20:13       ` Mark Brown
2016-01-06  6:49         ` Baolin Wang
2016-01-12 23:31         ` [dm-devel] " Mikulas Patocka
2016-01-12 23:38           ` Arnd Bergmann
2016-01-13  2:18             ` Mikulas Patocka
2016-01-13 10:17               ` Arnd Bergmann [this message]
2016-01-13 15:00                 ` Mikulas Patocka
2016-01-13  7:01             ` Milan Broz
2016-01-12 23:40           ` Mark Brown
2016-01-13  2:13             ` Mikulas Patocka
2016-01-14 11:35               ` Mark Brown

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=49336038.lhIkHu2mkF@wuerfel \
    --to=arnd@arndb.de \
    --cc=agk@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=baolin.wang@linaro.org \
    --cc=broonie@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dm-devel@redhat.com \
    --cc=gmazyland@gmail.com \
    --cc=keith.busch@intel.com \
    --cc=kent.overstreet@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mpatocka@redhat.com \
    --cc=neilb@suse.com \
    --cc=sagig@mellanox.com \
    --cc=snitzer@redhat.com \
    --cc=tj@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.