linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/4] null_blk: relaxed memory alignments
@ 2025-11-06  1:54 Keith Busch
  2025-11-06  1:54 ` [PATCHv2 1/4] null_blk: simplify copy_from_nullb Keith Busch
                   ` (6 more replies)
  0 siblings, 7 replies; 28+ messages in thread
From: Keith Busch @ 2025-11-06  1:54 UTC (permalink / raw)
  To: linux-block, hch, axboe, dlemoal, hans.holmberg; +Cc: Keith Busch

From: Keith Busch <kbusch@kernel.org>

The direct-io can work with arbitrary memory alignemnts, based on what
the block device's queue limits report. This series enhances the
null_blk driver by removing the software limitations that required
block size memory and length alignment.

Note, funny thing I noticed: this patch could allow null_blk to use
byte aligned memory, but the queue limits doesn't have a way to express
that. The smallest we can set the mask is 1, meaning 2-byte alignment,
because setting the mask to 0 is overridden by the default 511 mask. I'm
pretty sure at least some drivers are depending on the default, so can't
really change that.


Changes from v1:

 - A couple cosmetic patches to clean up some of the error handling, as
   noted by Damien.

 - Fixed up the buffer overruns that Hans reported.

 - Moved the kmap'ing to a layer lower in the call stack as suggested by
   Christoph, which also made it easier to fixup relying on
   virt_to_page. This part of the patch is split out into a prep patch
   this time.

Keith Busch (4):
  null_blk: simplify copy_from_nullb
  null_blk: consistently use blk_status_t
  null_blk: single kmap per bio segment
  null_blk: allow byte aligned memory offsets

 drivers/block/null_blk/main.c  | 77 ++++++++++++++++------------------
 drivers/block/null_blk/zoned.c |  2 +-
 2 files changed, 38 insertions(+), 41 deletions(-)

-- 
2.47.3


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

end of thread, other threads:[~2025-11-06 23:30 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06  1:54 [PATCHv2 0/4] null_blk: relaxed memory alignments Keith Busch
2025-11-06  1:54 ` [PATCHv2 1/4] null_blk: simplify copy_from_nullb Keith Busch
2025-11-06  3:51   ` Chaitanya Kulkarni
2025-11-06  4:12   ` Damien Le Moal
2025-11-06 10:48   ` Johannes Thumshirn
2025-11-06 11:51   ` Christoph Hellwig
2025-11-06  1:54 ` [PATCHv2 2/4] null_blk: consistently use blk_status_t Keith Busch
2025-11-06  3:52   ` Chaitanya Kulkarni
2025-11-06  4:13   ` Damien Le Moal
2025-11-06 10:52   ` Johannes Thumshirn
2025-11-06 11:52   ` Christoph Hellwig
2025-11-06  1:54 ` [PATCHv2 3/4] null_blk: single kmap per bio segment Keith Busch
2025-11-06  3:58   ` Chaitanya Kulkarni
2025-11-06  4:26   ` Damien Le Moal
2025-11-06 11:22   ` Johannes Thumshirn
2025-11-06 11:53   ` Christoph Hellwig
2025-11-06  1:54 ` [PATCHv2 4/4] null_blk: allow byte aligned memory offsets Keith Busch
2025-11-06  4:09   ` Chaitanya Kulkarni
2025-11-06  4:31   ` Damien Le Moal
2025-11-06  4:40     ` Keith Busch
2025-11-06 11:23   ` Johannes Thumshirn
2025-11-06 12:01   ` Christoph Hellwig
2025-11-06 15:24     ` Keith Busch
2025-11-06 15:42       ` Johannes Thumshirn
2025-11-06 15:43         ` hch
2025-11-06  4:11 ` [PATCHv2 0/4] null_blk: relaxed memory alignments Damien Le Moal
2025-11-06  8:35 ` Hans Holmberg
2025-11-06 23:30 ` Jens Axboe

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).