linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv3 0/8] direct-io: even more flexible io vectors
@ 2025-08-19 16:49 Keith Busch
  2025-08-19 16:49 ` [PATCHv3 1/8] block: check for valid bio while splitting Keith Busch
                   ` (10 more replies)
  0 siblings, 11 replies; 42+ messages in thread
From: Keith Busch @ 2025-08-19 16:49 UTC (permalink / raw)
  To: linux-block, linux-fsdevel, linux-kernel
  Cc: snitzer, axboe, dw, brauner, hch, martin.petersen, djwong,
	linux-xfs, viro, Keith Busch

From: Keith Busch <kbusch@kernel.org>

Previous version:

  https://lore.kernel.org/linux-block/20250805141123.332298-1-kbusch@meta.com/

This series removes the direct io requirement that io vector lengths
align to the logical block size.

I tested this on a few raw block device types including nvme,
virtio-blk, ahci, and loop. NVMe is the only one I tested with 4k
logical sectors; everything else was 512.

On each of those, I tested several iomap filesystems: xfs, ext4, and
btrfs. I found it interesting that each behave a little
differently with handling invalid vector alignments:

  - XFS is the most straight forward and reports failures on invalid
    vector conditions, same as raw blocks devices.

  - EXT4 falls back to buffered io for writes but not for reads.

  - BTRFS doesn't even try direct io for any unusual alignments; it
    chooses buffered io from the start.

So it has been a little slow going figuring out which results to expect
from various tests, but I think I've got all the corner cases covered. I
can submit the tests cases to blktests and fstests for consideration
separately, too.

I'm not 100% sure where we're at with the last patch. I think Mike
initially indicated this was okay to remove, but I could swear I read
something saying that might not be the case anymore. I just can't find
the message now. Mike?

Changes from v2:

  Include vector lengths when validating a split. The length check is
  only valid for r/w commands, and skipped for passthrough
  DRV_IN/DRV_OUT commands.

  Introduce a prep patch having bio_iov_iter_get_pages() take the
  caller's desired length alignment.

  Additional code comments explaing less obvious error conditions.

  Added reviews on the patches that haven't changed.

Keith Busch (8):
  block: check for valid bio while splitting
  block: add size alignment to bio_iov_iter_get_pages
  block: align the bio after building it
  block: simplify direct io validity check
  iomap: simplify direct io validity check
  block: remove bdev_iter_is_aligned
  blk-integrity: use simpler alignment check
  iov_iter: remove iov_iter_is_aligned

 block/bio-integrity.c  |  4 +-
 block/bio.c            | 64 ++++++++++++++++++----------
 block/blk-map.c        |  2 +-
 block/blk-merge.c      | 20 +++++++--
 block/fops.c           | 13 +++---
 fs/iomap/direct-io.c   |  6 +--
 include/linux/bio.h    | 13 ++++--
 include/linux/blkdev.h | 20 +++++----
 include/linux/uio.h    |  2 -
 lib/iov_iter.c         | 95 ------------------------------------------
 10 files changed, 94 insertions(+), 145 deletions(-)

-- 
2.47.3


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

end of thread, other threads:[~2025-09-02 14:39 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 16:49 [PATCHv3 0/8] direct-io: even more flexible io vectors Keith Busch
2025-08-19 16:49 ` [PATCHv3 1/8] block: check for valid bio while splitting Keith Busch
2025-08-20  7:02   ` Damien Le Moal
2025-08-20 14:25     ` Keith Busch
2025-08-20  7:04   ` Damien Le Moal
2025-08-25  7:35   ` Christoph Hellwig
2025-08-19 16:49 ` [PATCHv3 2/8] block: add size alignment to bio_iov_iter_get_pages Keith Busch
2025-08-25  7:36   ` Christoph Hellwig
2025-08-19 16:49 ` [PATCHv3 3/8] block: align the bio after building it Keith Busch
2025-08-20  7:07   ` Damien Le Moal
2025-08-25  7:46   ` Christoph Hellwig
2025-08-25 13:57     ` Keith Busch
2025-08-25  7:47   ` Christoph Hellwig
2025-08-26  0:37     ` Keith Busch
2025-08-26  8:02       ` Christoph Hellwig
2025-08-26 23:11         ` Keith Busch
2025-08-19 16:49 ` [PATCHv3 4/8] block: simplify direct io validity check Keith Busch
2025-08-25  7:48   ` Christoph Hellwig
2025-08-19 16:49 ` [PATCHv3 5/8] iomap: " Keith Busch
2025-08-25  7:48   ` Christoph Hellwig
2025-08-19 16:49 ` [PATCHv3 6/8] block: remove bdev_iter_is_aligned Keith Busch
2025-08-25  7:48   ` Christoph Hellwig
2025-08-19 16:49 ` [PATCHv3 7/8] blk-integrity: use simpler alignment check Keith Busch
2025-08-25  7:49   ` Christoph Hellwig
2025-08-19 16:49 ` [PATCHv3 8/8] iov_iter: remove iov_iter_is_aligned Keith Busch
2025-08-25  7:50   ` Christoph Hellwig
2025-08-19 23:36 ` [PATCHv3 0/8] direct-io: even more flexible io vectors Mike Snitzer
2025-08-20  1:52 ` Song Chen
2025-08-22 13:27 ` Ritesh Harjani
2025-08-22 14:30   ` Keith Busch
2025-08-25 12:07   ` Jan Kara
2025-08-25 14:53     ` Keith Busch
2025-08-26  4:59       ` Ritesh Harjani
2025-08-27 15:20         ` Jan Kara
2025-08-27 16:09           ` Mike Snitzer
2025-09-01  7:55             ` Jan Kara
2025-09-02 14:39               ` Mike Snitzer
2025-08-27 17:52           ` Brian Foster
2025-08-27 19:20           ` Keith Busch
2025-09-01  8:22             ` Jan Kara
2025-08-29  2:11           ` Ritesh Harjani
2025-08-29  3:19             ` Ritesh Harjani

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