Skip to content

block: another block copy offload

Keith Busch linux-block linux-nvme llvm oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 40 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5block: new sector copy apiblock/blk-lib.c block/ioctl.c include/linux/blkdev.h +1 more+97 -011 replies
2/5block: add support for copy offloadblock/bio.c block/blk-core.c block/blk-lib.c +8 more+226 -138 replies
3/5nvme: add support for copy offloaddrivers/nvme/host/core.c include/linux/nvme.h+102 -112 replies
4/5block: add support for vectored copiesblock/blk-lib.c block/ioctl.c include/linux/blkdev.h +1 more+111 -142 replies
5/5nvmet: implement copy support for bdev backed targetdrivers/nvme/target/io-cmd-bdev.c+52 -04 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchHannes Reinecke
1/5
2/5
3/5
4/5
5/5R-b

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

Read the v1 thread

Cover letter [PATCH 0/5] block: another block copy offload

From: Keith Busch <[email protected]>

I was never happy with previous block copy offload attempts, so I had to take a stab at it. And I was recently asked to take a look at this, so here goes.

Some key implementation differences from previous approaches:

1. Only one bio is needed to describe a copy request, so no plugging or dispatch tricks required. Like read and write requests, these can be artbitrarily large and will be split as needed based on the request_queue's limits. The bio's are mergeable with other copy commands on adjacent destination sectors.

2. You can describe as many source sectors as you want in a vector in a single bio. This aligns with the nvme protocol's Copy implementation, which can be used to efficiently defragment scattered blocks into a contiguous destination with a single command.

Oh, and the nvme-target support was included with this patchset too, so there's a purely in-kernel way to test out the code paths if you don't have otherwise capable hardware. I also used qemu since that nvme device supports copy offload too.

Keith Busch (5):
block: new sector copy api
block: add support for copy offload
nvme: add support for copy offload
block: add support for vectored copies
nvmet: implement copy support for bdev backed target

 block/bio.c                       |  25 +++++++
 block/blk-core.c                  |   4 ++
 block/blk-lib.c                   | 115 ++++++++++++++++++++++++++++++
 block/blk-merge.c                 |  28 +++++++-
 block/blk-sysfs.c                 |   9 +++
 block/blk.h                       |  17 ++++-
 block/ioctl.c                     |  89 +++++++++++++++++++++++
 drivers/nvme/host/core.c          |  61 ++++++++++++++++
 drivers/nvme/target/io-cmd-bdev.c |  52 ++++++++++++++
 include/linux/bio.h               |  20 ++++++
 include/linux/blk-mq.h            |   5 ++
 include/linux/blk_types.h         |   2 +
 include/linux/blkdev.h            |  18 +++++
 include/linux/bvec.h              |  68 +++++++++++++++++-
 include/linux/nvme.h              |  42 ++++++++++-
 include/uapi/linux/fs.h           |  17 +++++
 16 files changed, 566 insertions(+), 6 deletions(-)
Signature · 1 line
2.47.1