|
|
Log in / Subscribe / Register

dm-crypt: support relaxed memory alignment

From:  Keith Busch <kbusch-AT-meta.com>
To:  <dm-devel-AT-lists.linux.dev>, <snitzer-AT-kernel.org>, <hch-AT-lst.de>, <ebiggers-AT-kernel.org>
Subject:  [RESEND PATCHv3 0/2] dm-crypt: support relaxed memory alignment
Date:  Wed, 14 Jan 2026 07:49:52 -0800
Message-ID:  <20260114154954.3282207-1-kbusch@meta.com>
Cc:  <linux-block-AT-vger.kernel.org>, <axboe-AT-kernel.dk>, Keith Busch <kbusch-AT-kernel.org>
Archive-link:  Article

From: Keith Busch <kbusch@kernel.org>

Resending as the previous send was bad timing with the merge window.

Direct-io can support any memory alignment the hardware allows. Device
mappers don't need to impose any software constraints on memory
alignment, so this series removes one of those limitations the dm-crypt
mapper.

Changes from v2:

 * Don't change the default stacking limit to allow the relaxed memory
   alignment requirements; have the caller do it instead.

 * Fixed scatterlist memory leaks when handling the case that can't
   use the inline scatterlist.

 * Fixed segment boundary check to use the crypt_config rather than the
   lower level block device's dma_alignment, which may not be the same
   size as the cc->sector_size which was used before, or the newly
   enabled 4-byte alignment this patch set allows in certain
   circumstances. 

Keith Busch (2):
  dm-crypt: allow unaligned bio_vecs for direct io
  dm-crypt: dynamic scatterlist for many segments

 drivers/md/dm-crypt.c | 114 ++++++++++++++++++++++++++++++++++--------
 drivers/md/dm-table.c |   1 +
 2 files changed, 94 insertions(+), 21 deletions(-)

-- 
2.47.3




Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds