Skip to content

block, nvme: removing virtual boundary mask reliance

Keith Busch linux-block linux-nvme 5 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 22 repliesApplied
  2. v42 patches 4 repliesSuperseded
  3. v32 patches 10 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches2 repliesSuperseded
v12 patches13 repliesSuperseded

Changes in v5 from the cover letter

* Keep the same lowest-set-bit representation in the request as the bio; provide a helper to turn it into a mask

* Open-code the bvec gaps calculation since the helper is being removed

* Additional code comments

* Keeping the virt boundary unchanged for the loop target for now. Only pci, tcp, and fc are not reporting such a boundary.

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/2block: accumulate memory segment gaps per bioblock/bio.c block/blk-map.c block/blk-merge.c +5 more+77 -518 replies
2/2nvme: remove virtual boundary for sgl capable devicesdrivers/nvme/host/apple.c drivers/nvme/host/core.c drivers/nvme/host/fabrics.h +6 more+48 -81 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchChristoph HellwigMartin K. Petersen
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCHv5 0/2] block, nvme: removing virtual boundary mask reliance

From: Keith Busch <[email protected]>

Previous version here:

https://lore.kernel.org/linux-block/[email protected]/

The purpose is to allow optimization decisions to happen per IO, and flexibility to utilize unaligned buffers for hardware that supports it.

The virtual boundary that NVMe uses provides specific guarantees about the data alignment, but that might not be large enough for some CPU architectures to take advantage of even if an applications uses aligned data buffers that could use it.

At the same time, the virtual boundary prevents the driver from directly using memory in ways the hardware may be capable of accessing. This creates unnecessary needs on applications to double buffer their data into a more restrictive virtually contiguous format.

This patch series provides an efficient way to track segment boundary gaps per-IO so that the optimizations can be decided per-IO. This provides flexibility to use all hardware to their abilities beyond what the virtual boundary mask can provide.

Note, abuse of this capability may result in worse performance compared to the bounce buffer solutions. Sending a bunch of tiny vectors for one IO incurs significant protocol overhead, so while this patch set allows you to do that, I recommend that you don't. We can't enforce a minimum size though because vectors may straddle pages with only a few words in the first and/or last pages, which we do need to support.

Changes from v4:

* Keep the same lowest-set-bit representation in the request as the bio; provide a helper to turn it into a mask

* Open-code the bvec gaps calculation since the helper is being removed

* Additional code comments

* Keeping the virt boundary unchanged for the loop target for now. Only pci, tcp, and fc are not reporting such a boundary.

Keith Busch (2):
block: accumulate memory segment gaps per bio
nvme: remove virtual boundary for sgl capable devices

 block/bio.c                 |  1 +
 block/blk-map.c             |  3 +++
 block/blk-merge.c           | 39 ++++++++++++++++++++++++++++++++++---
 block/blk-mq-dma.c          |  3 +--
 block/blk-mq.c              |  6 ++++++
 drivers/nvme/host/apple.c   |  1 +
 drivers/nvme/host/core.c    | 10 +++++-----
 drivers/nvme/host/fabrics.h |  6 ++++++
 drivers/nvme/host/fc.c      |  1 +
 drivers/nvme/host/nvme.h    |  7 +++++++
 drivers/nvme/host/pci.c     | 28 +++++++++++++++++++++++---
 drivers/nvme/host/rdma.c    |  1 +
 drivers/nvme/host/tcp.c     |  1 +
 drivers/nvme/target/loop.c  |  1 +
 include/linux/bio.h         |  2 ++
 include/linux/blk-mq.h      | 16 +++++++++++++++
 include/linux/blk_types.h   | 12 ++++++++++++
 17 files changed, 125 insertions(+), 13 deletions(-)
Signature · 1 line
2.47.3