Skip to content

Block storage copy offloading

Bart Van Assche linux-block linux-nvme linux-scsi 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12block: Introduce queue limits for copy offloadingDocumentation/ABI/stable/sysfs-block block/blk-settings.c block/blk-sysfs.c +1 more+112 -10 replies
2/12block: Add the REQ_OP_COPY_{SRC,DST} operationsblock/bio.c block/blk-core.c block/blk-merge.c +3 more+120 -00 replies
3/12block: Introduce blkdev_copy_offload()block/Makefile block/blk-copy.c include/linux/blk_types.h +1 more+397 -10 replies
4/12block: Add an onloaded copy implementationblock/blk-copy.c include/linux/blkdev.h+230 -00 replies
5/12block: Introduce accessor functions for copy offload biosblock/blk-copy.c include/linux/blk-copy.h+51 -00 replies
6/12fs/read_write: Generalize generic_copy_file_checks()fs/read_write.c+5 -30 replies
7/12fs, block: Add copy_file_range() support for block devicesblock/fops.c+54 -00 replies
8/12nvme: Add copy offloading supportdrivers/nvme/host/constants.c drivers/nvme/host/core.c drivers/nvme/host/trace.c +1 more+169 -30 replies
9/12nvmet: Support the Copy commanddrivers/nvme/host/trace.c drivers/nvme/target/admin-cmd.c drivers/nvme/target/io-cmd-bdev.c +3 more+179 -80 replies
10/12dm: Add support for copy offloadingdrivers/md/dm-table.c+8 -00 replies
11/12dm-linear: Enable copy offloadingdrivers/md/dm-linear.c+6 -00 replies
12/12null_blk: Add support for REQ_OP_COPY_*Documentation/block/null_blk.rst drivers/block/null_blk/main.c drivers/block/null_blk/null_blk.h+118 -00 replies

Reviews trailers per patch

2 of 12 patches have a Reviewed-by or Acked-by.

PatchHannes Reinecke
1/12
2/12
3/12
4/12
5/12
6/12R-b
7/12R-b
8/12
9/12
10/12
11/12
12/12

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 00/12] Block storage copy offloading

Hi Jens,

This patch series implements a new approach for copy offloading. Compared to Nitesh' approach, the differences are as follows:
- Two new limits have been introduced representing the maximum number of source and destination ranges. Support for multiple source ranges for the NVMe Copy command has been added.
- The blkdev_copy_offload() function can now submit multiple copy offload commands instead of only one.
- The implementation no longer depends on block layer plugging.

This patch series includes copy offloading support for the Linux kernel block layer core, the device mapper core, the null_blk and the NVMe and nvmet drivers. Support for the scsi_debug and SCSI core will follow later.

Test scripts are available here:
https://github.com/bvanassche/blktests/tree/copy-offloading

See also Bart Van Assche, [LSF/MM/BPF TOPIC] Block storage copy offloading, January 2026
(https://lore.kernel.org/all/[email protected]/).

See also Nitesh Shetty, Implement copy offload support, May 2024
(https://lore.kernel.org/linux-block/[email protected]/).

Anuj Gupta (1):
fs/read_write: Generalize generic_copy_file_checks()

Bart Van Assche (4):
block: Introduce blkdev_copy_offload()
block: Introduce accessor functions for copy offload bios
dm: Add support for copy offloading
dm-linear: Enable copy offloading

Nitesh Shetty (7):
block: Introduce queue limits for copy offloading
block: Add the REQ_OP_COPY_{SRC,DST} operations
block: Add an onloaded copy implementation
fs, block: Add copy_file_range() support for block devices
nvme: Add copy offloading support
nvmet: Support the Copy command
null_blk: Add support for REQ_OP_COPY_*

 Documentation/ABI/stable/sysfs-block |  24 +
 Documentation/block/null_blk.rst     |   4 +
 block/Makefile                       |   2 +-
 block/bio.c                          |   1 +
 block/blk-copy.c                     | 631 +++++++++++++++++++++++++++
 block/blk-core.c                     |  38 ++
 block/blk-merge.c                    |  13 +
 block/blk-settings.c                 |  36 ++
 block/blk-sysfs.c                    |  35 ++
 block/blk.h                          |   5 +
 block/fops.c                         |  54 +++
 drivers/block/null_blk/main.c        | 113 +++++
 drivers/block/null_blk/null_blk.h    |   1 +
 drivers/md/dm-linear.c               |   6 +
 drivers/md/dm-table.c                |   8 +
 drivers/nvme/host/constants.c        |   1 +
 drivers/nvme/host/core.c             | 106 +++++
 drivers/nvme/host/trace.c            |  21 +-
 drivers/nvme/target/admin-cmd.c      |  26 +-
 drivers/nvme/target/io-cmd-bdev.c    |  80 ++++
 drivers/nvme/target/io-cmd-file.c    |  59 ++-
 drivers/nvme/target/trace.c          |  19 +
 fs/read_write.c                      |   8 +-
 include/linux/blk-copy.h             |  50 +++
 include/linux/blk_types.h            |  57 +++
 include/linux/blkdev.h               |  20 +-
 include/linux/nvme.h                 |  47 +-
 27 files changed, 1449 insertions(+), 16 deletions(-)
 create mode 100644 block/blk-copy.c
 create mode 100644 include/linux/blk-copy.h