linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] block: another block copy offload
@ 2025-05-21 22:31 Keith Busch
  2025-05-21 22:31 ` [PATCH 1/5] block: new sector copy api Keith Busch
                   ` (6 more replies)
  0 siblings, 7 replies; 46+ messages in thread
From: Keith Busch @ 2025-05-21 22:31 UTC (permalink / raw)
  To: linux-block, linux-nvme; +Cc: Keith Busch

From: Keith Busch <kbusch@kernel.org>

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

-- 
2.47.1


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

end of thread, other threads:[~2025-07-03 14:47 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-21 22:31 [PATCH 0/5] block: another block copy offload Keith Busch
2025-05-21 22:31 ` [PATCH 1/5] block: new sector copy api Keith Busch
2025-05-22 10:02   ` Hannes Reinecke
2025-05-22 16:43     ` Keith Busch
2025-05-22 19:22   ` Bart Van Assche
2025-05-22 20:04     ` Keith Busch
2025-05-23 12:45   ` Christoph Hellwig
2025-05-23 17:02     ` Keith Busch
2025-05-26  5:18       ` Christoph Hellwig
2025-05-27 17:45         ` Keith Busch
2025-05-28  7:46           ` Christoph Hellwig
2025-05-28 22:41             ` Keith Busch
2025-06-02  4:58               ` Christoph Hellwig
2025-05-21 22:31 ` [PATCH 2/5] block: add support for copy offload Keith Busch
2025-05-22 13:49   ` Hannes Reinecke
2025-05-23 12:46   ` Christoph Hellwig
2025-05-23 13:26     ` Keith Busch
2025-05-23 13:37       ` Christoph Hellwig
2025-05-23 13:48         ` Keith Busch
2025-05-26  5:22           ` Christoph Hellwig
2025-05-27 21:33         ` Keith Busch
2025-05-28  7:47           ` Christoph Hellwig
2025-05-21 22:31 ` [PATCH 3/5] nvme: " Keith Busch
2025-05-22  0:47   ` Caleb Sander Mateos
2025-05-22  0:51     ` Caleb Sander Mateos
2025-05-22  3:23       ` Keith Busch
2025-05-22  3:41         ` Caleb Sander Mateos
2025-05-22  4:29           ` Keith Busch
2025-05-22 14:16             ` Caleb Sander Mateos
2025-05-23 12:49             ` Christoph Hellwig
2025-05-23 12:48           ` Christoph Hellwig
2025-05-22 13:54   ` Hannes Reinecke
2025-05-23 12:50     ` Christoph Hellwig
2025-05-23 14:22       ` Caleb Sander Mateos
2025-06-09  9:29   ` Niklas Cassel
2025-05-21 22:31 ` [PATCH 4/5] block: add support for vectored copies Keith Busch
2025-05-22 13:58   ` Hannes Reinecke
2025-05-22 16:36     ` Keith Busch
2025-05-21 22:31 ` [PATCH 5/5] nvmet: implement copy support for bdev backed target Keith Busch
2025-05-22 13:59   ` Hannes Reinecke
2025-05-23 13:18   ` Christoph Hellwig
2025-05-23 14:00     ` Keith Busch
2025-05-23 14:02       ` Christoph Hellwig
2025-05-22 15:52 ` [PATCH 0/5] block: another block copy offload Bart Van Assche
2025-05-23 12:53   ` Christoph Hellwig
2025-07-03 14:47 ` Niklas Cassel

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