linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* move blk-crypto-fallback to sit above the block layer
@ 2025-10-31  9:34 Christoph Hellwig
  2025-10-31  9:34 ` [PATCH 1/9] mempool: update kerneldoc comments Christoph Hellwig
                   ` (8 more replies)
  0 siblings, 9 replies; 41+ messages in thread
From: Christoph Hellwig @ 2025-10-31  9:34 UTC (permalink / raw)
  To: Jens Axboe, Eric Biggers, Vlastimil Babka, Andrew Morton
  Cc: Christoph Lameter, David Rientjes, Roman Gushchin, Harry Yoo,
	linux-block, linux-fsdevel, linux-fscrypt, linux-mm

Hi all,

in the past we had various discussions that doing the blk-crypto fallback
below the block layer causes all kinds of problems due to very late
splitting and communicating up features.

This series turns that call chain upside down by requiring the caller to
call into blk-crypto using a new submit_bio wrapper instead so that only
hardware encryption bios are passed through the block layer as such.

While doings this I also noticed that the existing blk-crypto-fallback
code does various unprotected memory allocations which this converts to
mempools, or from loops of mempool allocations to the new safe batch
mempool allocator.

There might be future avenues for optimization by using high order
folio allocations that match the file systems preferred folio size,
but for that'd probably want a batch folio allocator first, in addition
to deferring it to avoid scope creep.

Diffstat:
 block/blk-core.c            |   10 -
 block/blk-crypto-fallback.c |  437 ++++++++++++++++++++------------------------
 block/blk-crypto-internal.h |   31 +--
 block/blk-crypto.c          |   65 ++----
 fs/buffer.c                 |    3 
 fs/crypto/bio.c             |   89 +++++---
 fs/ext4/page-io.c           |    3 
 fs/ext4/readpage.c          |    9 
 fs/f2fs/data.c              |    4 
 fs/f2fs/file.c              |    3 
 fs/iomap/direct-io.c        |    3 
 include/linux/blk-crypto.h  |   16 +
 include/linux/mempool.h     |    7 
 mm/mempool.c                |  173 ++++++++++++-----
 14 files changed, 464 insertions(+), 389 deletions(-)


^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2025-11-14  5:57 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31  9:34 move blk-crypto-fallback to sit above the block layer Christoph Hellwig
2025-10-31  9:34 ` [PATCH 1/9] mempool: update kerneldoc comments Christoph Hellwig
2025-11-05 14:02   ` Vlastimil Babka
2025-11-05 14:14     ` Vlastimil Babka
2025-11-07  3:26   ` Eric Biggers
2025-11-07 12:02     ` Christoph Hellwig
2025-10-31  9:34 ` [PATCH 2/9] mempool: add error injection support Christoph Hellwig
2025-11-05 14:04   ` Vlastimil Babka
2025-11-07  3:29   ` Eric Biggers
2025-11-07 12:04     ` Christoph Hellwig
2025-10-31  9:34 ` [PATCH 3/9] mempool: add mempool_{alloc,free}_bulk Christoph Hellwig
2025-11-05 15:04   ` Vlastimil Babka
2025-11-06 14:13     ` Christoph Hellwig
2025-11-06 14:27       ` Vlastimil Babka
2025-11-06 14:48         ` Christoph Hellwig
2025-11-06 14:57           ` Vlastimil Babka
2025-11-06 15:00             ` Christoph Hellwig
2025-11-06 15:09               ` Vlastimil Babka
2025-11-07  3:52   ` Eric Biggers
2025-11-07 12:06     ` Christoph Hellwig
2025-10-31  9:34 ` [PATCH 4/9] fscrypt: pass a real sector_t to fscrypt_zeroout_range_inline_crypt Christoph Hellwig
2025-11-07  3:55   ` Eric Biggers
2025-11-07 12:07     ` Christoph Hellwig
2025-10-31  9:34 ` [PATCH 5/9] fscrypt: keep multiple bios in flight in fscrypt_zeroout_range_inline_crypt Christoph Hellwig
2025-11-07  4:06   ` Eric Biggers
2025-10-31  9:34 ` [PATCH 6/9] blk-crypto: optimize bio splitting in blk_crypto_fallback_encrypt_bio Christoph Hellwig
2025-11-14  0:22   ` Eric Biggers
2025-11-14  5:56     ` Christoph Hellwig
2025-10-31  9:34 ` [PATCH 7/9] blk-crypto: handle the fallback above the block layer Christoph Hellwig
2025-11-07  4:42   ` Eric Biggers
2025-11-07 12:10     ` Christoph Hellwig
2025-11-14  0:37   ` Eric Biggers
2025-11-14  5:56     ` Christoph Hellwig
2025-10-31  9:34 ` [PATCH 8/9] blk-crypto: use on-stack skciphers for fallback en/decryption Christoph Hellwig
2025-11-07  4:18   ` Eric Biggers
2025-11-07 12:10     ` Christoph Hellwig
2025-11-14  0:32   ` Eric Biggers
2025-11-14  5:57     ` Christoph Hellwig
2025-10-31  9:34 ` [PATCH 9/9] blk-crypto: use mempool_alloc_bulk for encrypted bio page allocation Christoph Hellwig
2025-11-05 15:12   ` Vlastimil Babka
2025-11-06 14:01     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).