Skip to content

block: support for partial sector reads

Keith Busch linux-block linux-fsdevel linux-nvme 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12block: move direct io alignment check to commonblock/fops.c include/linux/blkdev.h+22 -290 replies
2/12iomap: save copy of bdev for direct iofs/iomap/direct-io.c+4 -30 replies
3/12iomap: get logical block size directlyfs/iomap/direct-io.c+2 -20 replies
4/12iomap: use common blkdev alignment checkfs/iomap/direct-io.c+1 -30 replies
5/12block: add bit bucket capabilitiesblock/bio.c block/blk-core.c block/blk-merge.c +4 more+52 -30 replies
6/12nvme: add support for bit bucketsdrivers/nvme/host/core.c drivers/nvme/host/nvme.h drivers/nvme/host/pci.c +1 more+26 -20 replies
7/12block: allow copying pre-registered bvecsblock/bio.c+13 -01 reply
8/12block: add bio number of vecs helper for partialsinclude/linux/bio.h+11 -00 replies
9/12block: add partial sector parameter helperinclude/linux/blkdev.h+21 -00 replies
10/12block: add direct-io partial sector read supportblock/fops.c+56 -130 replies
11/12iomap: add direct-io partial sector read supportfs/iomap/direct-io.c+28 -80 replies
12/12block: export and document bit_bucket attributeDocumentation/ABI/stable/sysfs-block block/blk-sysfs.c+12 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/12] block: support for partial sector reads

From: Keith Busch <[email protected]>

At LSFMM nearly 2 months ago, I discussed how some storage hardware supports the ability to read at granularities smaller than a sector, and the nvme protocol feature that enables this capability, "bit buckets". This is useful in scenarios where only parts of sectors are used by the application, and the primary benefits to support this are:

* Improved link bandwidth usage
* Reduced memory utilization

This series enables the block layer and nvme to set up bit bucket descriptors for read commands, then enables user space direct-io to make use of this capability by allowing the user to specify an arbitrary offset and length. This allows truncating an arbitrary number of bytes off sectors from the front and end of the transfer.

There are no current in-kernel users beyond the direct-io cases, but this could also be used for to truncate bytes out of the middle of a transfer as well. For example, if you wanted to read a page and knew you wer going to immediately dirty some number of bytes in the middle, you could set up a read request to skip those in the data transfer.

Keith Busch (12):
block: move direct io alignment check to common
iomap: save copy of bdev for direct io
iomap: get logical block size directly
iomap: use common blkdev alignment check
block: add bit bucket capabilities
nvme: add support for bit buckets
block: allow copying pre-registered bvecs
block: add bio number of vecs helper for partials
block: add partial sector parameter helper
block: add direct-io partial sector read support
iomap: add direct io partial sector read support
block: export and document bit_bucket attribute

 Documentation/ABI/stable/sysfs-block |  9 +++
 block/bio.c                          | 42 +++++++++++-
 block/blk-core.c                     |  5 ++
 block/blk-merge.c                    |  3 +-
 block/blk-mq.c                       |  2 +
 block/blk-sysfs.c                    |  3 +
 block/fops.c                         | 97 ++++++++++++++++++----------
 drivers/nvme/host/core.c             |  3 +
 drivers/nvme/host/nvme.h             |  6 ++
 drivers/nvme/host/pci.c              | 17 ++++-
 fs/iomap/direct-io.c                 | 43 ++++++++----
 include/linux/bio.h                  | 11 ++++
 include/linux/blk-mq.h               |  2 +
 include/linux/blk_types.h            |  1 +
 include/linux/blkdev.h               | 41 ++++++++++++
 include/linux/nvme.h                 |  2 +
 16 files changed, 236 insertions(+), 51 deletions(-)
Signature · 1 line
2.30.2