o access it, causing a crash on this statement
"md->disk->private_data = NULL;".
Signed-off-by: Mikulas Patocka
Reported-by: Chenyuan Yang
Closes: https://marc.info/?l=dm-devel&m=172824125004329&w=2
Cc: sta...@vger.kernel.org
Reviewed-by: Nitesh Shetty
: Nitesh Shetty
n Broz
Signed-off-by: Shin'ichiro Kawasaki
---
This patch addresses a failure found during the debug work for another
dm/002 failure [1].
[1]
https://lore.kernel.org/linux-block/42ecobcsduvlqh77iavjj2p3ewdh7u4opdz4xruauz4u5ddljz@yr7ye4fq72tr/
Tested-by: Nitesh Shetty
Changes from v2:
*
eaches blk_mq_submit_bio, this will
retrieve the destination BIO from bi_copy_ctx and form a request with
destination BIO and source BIO. After this request will be sent to
driver.
This work is still in POC phase[2]. But this approach makes lifetime
management of BIO complicated, especially durin
ence
chain won't be maintained.
[1] https://lore.kernel.org/all/d7ae00c8-c038-4bed-937e-51bc6...@acm.org/
Thank You,
Nitesh Shetty
_end_io = blkdev_copy_offload_src_endio;
+ src_bio->bi_private = offload_io;
+
+ atomic_inc(&cio->refcount);
+ submit_bio(src_bio);
+ blk_finish_plug(&plug);
plugs should be hold over all I/Os, submitted from the same caller,
which is the point of them.
Acked
Thank You,
Nitesh Shetty
On 01/06/24 07:53AM, Christoph Hellwig wrote:
On Mon, May 20, 2024 at 03:50:14PM +0530, Nitesh Shetty wrote:
Add device limits as sysfs entries,
- copy_max_bytes (RW)
- copy_max_hw_bytes (RO)
Above limits help to split the copy payload in block layer.
copy_max_bytes: maximum
On 01/06/24 08:22AM, Christoph Hellwig wrote:
On Mon, May 20, 2024 at 03:50:20PM +0530, Nitesh Shetty wrote:
+ if (blk_rq_nr_phys_segments(req) != BLK_COPY_MAX_SEGMENTS)
+ return BLK_STS_IOERR;
This sounds like BLK_COPY_MAX_SEGMENTS is misnamed. Right now this is
not a
On 01/06/24 08:23AM, Christoph Hellwig wrote:
On Mon, May 20, 2024 at 03:50:24PM +0530, Nitesh Shetty wrote:
This is a prep patch to enable copy trace capability.
At present only zoned null_block is using trace, so we decoupled trace
and zoned dependency to make it usable in null_blk driver
On 01/06/24 07:47AM, Christoph Hellwig wrote:
On Mon, May 20, 2024 at 03:50:13PM +0530, Nitesh Shetty wrote:
So copy offload works only for request based storage drivers.
I don't think that is actually true. It just requires a fair amount of
code in a bio based driver to match the bi
On 30/05/24 10:11AM, Bart Van Assche wrote:
On 5/30/24 00:16, Nitesh Shetty wrote:
+static inline bool blk_copy_offload_attempt_combine(struct request_queue *q,
+ struct bio *bio)
+{
+ struct blk_plug *plug = current->plug;
+ struct request *rq;
+
+ if (!p
On 29/05/24 03:41PM, Bart Van Assche wrote:
On 5/29/24 12:48 AM, Damien Le Moal wrote:
On 5/29/24 15:17, Nitesh Shetty wrote:
On 24/05/24 01:33PM, Bart Van Assche wrote:
On 5/20/24 03:20, Nitesh Shetty wrote:
We add two new opcode REQ_OP_COPY_DST, REQ_OP_COPY_SRC.
Since copy is a composite
On 24/05/24 01:33PM, Bart Van Assche wrote:
On 5/20/24 03:20, Nitesh Shetty wrote:
We add two new opcode REQ_OP_COPY_DST, REQ_OP_COPY_SRC.
Since copy is a composite operation involving src and dst sectors/lba,
each needs to be represented by a separate bio to make it compatible
with device
On 26/05/24 09:02AM, Dave Chinner wrote:
On Mon, May 20, 2024 at 03:50:18PM +0530, Nitesh Shetty wrote:
From: Anuj Gupta
This is a prep patch. Allow copy_file_range to work for block devices.
Relaxing generic_copy_file_checks allows us to reuse the existing infra,
instead of adding a new user
On 26/05/24 09:09AM, Dave Chinner wrote:
On Mon, May 20, 2024 at 03:50:19PM +0530, Nitesh Shetty wrote:
For direct block device opened with O_DIRECT, use blkdev_copy_offload to
issue device copy offload, or use splice_copy_file_range in case
device copy offload capability is absent or the
On 24/05/24 06:52AM, Bart Van Assche wrote:
On 5/23/24 23:54, Nitesh Shetty wrote:
Regarding merge, does it looks any better, if we use single request
operation such as REQ_OP_COPY and use op_flags(REQ_COPY_DST/REQ_COPY_SRC)
to identify dst and src bios ?
I prefer to keep the current approach
On 21/05/24 09:01AM, Hannes Reinecke wrote:
On 5/20/24 12:20, Nitesh Shetty wrote:
We add two new opcode REQ_OP_COPY_DST, REQ_OP_COPY_SRC.
Since copy is a composite operation involving src and dst sectors/lba,
each needs to be represented by a separate bio to make it compatible
with device
On 22/05/24 11:05AM, Bart Van Assche wrote:
On 5/20/24 03:20, Nitesh Shetty wrote:
We add two new opcode REQ_OP_COPY_DST, REQ_OP_COPY_SRC.
Since copy is a composite operation involving src and dst sectors/lba,
each needs to be represented by a separate bio to make it compatible
with device
On 22/05/24 10:49AM, Bart Van Assche wrote:
On 5/21/24 07:25, Nitesh Shetty wrote:
On 20/05/24 03:42PM, Bart Van Assche wrote:
On 5/20/24 03:20, Nitesh Shetty wrote:
+ if (max_copy_bytes & (queue_logical_block_size(q) - 1))
+ return -EINVAL;
Wouldn't it be more user-fr
On 22/05/24 10:52AM, Bart Van Assche wrote:
On 5/21/24 07:46, Nitesh Shetty wrote:
On 20/05/24 04:42PM, Bart Van Assche wrote:
On 5/20/24 03:20, Nitesh Shetty wrote:
+ __rq_for_each_bio(bio, req) {
+ if (seg == blk_rq_nr_phys_segments(req)) {
+ sector_in = bio
On 22/05/24 08:22AM, Hannes Reinecke wrote:
On 5/21/24 16:08, Nitesh Shetty wrote:
On 21/05/24 09:11AM, Hannes Reinecke wrote:
On 5/20/24 12:20, Nitesh Shetty wrote:
Before enabling copy for dm target, check if underlying devices and
dm target support copy. Avoid split happening inside dm
On 20/05/24 04:33PM, Damien Le Moal wrote:
On 2024/05/20 12:20, Nitesh Shetty wrote:
@@ -231,10 +237,11 @@ int blk_set_default_limits(struct queue_limits *lim)
{
/*
* Most defaults are set by capping the bounds in blk_validate_limits,
-* but max_user_discard_sectors is
On 20/05/24 04:25PM, Bart Van Assche wrote:
On 5/20/24 03:20, Nitesh Shetty wrote:
Setting copy_offload_supported flag to enable offload.
I think that the description of this patch should explain why it is safe
to set the 'copy_offload_supported' flag for the dm-linear driver.
A
On 20/05/24 03:42PM, Bart Van Assche wrote:
On 5/20/24 03:20, Nitesh Shetty wrote:
+static ssize_t queue_copy_max_show(struct request_queue *q, char *page)
+{
+ return sprintf(page, "%llu\n", (unsigned long long)
+ q->limits.max_copy_sectors &l
On 20/05/24 04:42PM, Bart Van Assche wrote:
On 5/20/24 03:20, Nitesh Shetty wrote:
+ if (blk_rq_nr_phys_segments(req) != BLK_COPY_MAX_SEGMENTS)
+ return status;
Why is this check necessary?
+ /*
+* First bio contains information about destination and last
On 21/05/24 09:11AM, Hannes Reinecke wrote:
On 5/20/24 12:20, Nitesh Shetty wrote:
Before enabling copy for dm target, check if underlying devices and
dm target support copy. Avoid split happening inside dm target.
Fail early if the request needs split, currently splitting copy
request is not
On 21/05/24 09:06AM, Hannes Reinecke wrote:
On 5/20/24 12:20, Nitesh Shetty wrote:
For the devices which does not support copy, copy emulation is added.
It is required for in-kernel users like fabrics, where file descriptor is
not available and hence they can't use copy_file_range.
On 20/05/24 04:00PM, Bart Van Assche wrote:
On 5/20/24 03:20, Nitesh Shetty wrote:
Upon arrival of source bio we merge these two bio's and send
corresponding request down to device driver.
bios with different operation types must not be merged.
Copy is a composite operation which ha
On 20/05/24 05:00PM, Damien Le Moal wrote:
On 2024/05/20 12:20, Nitesh Shetty wrote:
We add two new opcode REQ_OP_COPY_DST, REQ_OP_COPY_SRC.
Since copy is a composite operation involving src and dst sectors/lba,
each needs to be represented by a separate bio to make it compatible
with device
tracing.
Reviewed-by: Hannes Reinecke
Suggested-by: Damien Le Moal
Signed-off-by: Anuj Gupta
Signed-off-by: Nitesh Shetty
Signed-off-by: Vincent Fu
---
Documentation/block/null_blk.rst | 5 ++
drivers/block/null_blk/main.c | 102 +-
drivers/block/null_blk
This is a prep patch to enable copy trace capability.
At present only zoned null_block is using trace, so we decoupled trace
and zoned dependency to make it usable in null_blk driver also.
Reviewed-by: Hannes Reinecke
Signed-off-by: Nitesh Shetty
Signed-off-by: Anuj Gupta
---
drivers/block
Setting copy_offload_supported flag to enable offload.
Reviewed-by: Hannes Reinecke
Signed-off-by: Nitesh Shetty
---
drivers/md/dm-linear.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c
index 2d3e186ca87e..cfec2fac28e1 100644
--- a/drivers
Before enabling copy for dm target, check if underlying devices and
dm target support copy. Avoid split happening inside dm target.
Fail early if the request needs split, currently splitting copy
request is not supported.
Signed-off-by: Nitesh Shetty
---
drivers/md/dm-table.c | 37
vfs_copy_file_range to service our request.
Currently target always shows copy capability by setting
NVME_CTRL_ONCS_COPY in controller ONCS.
loop target has copy support, which can be used to test copy offload.
trace event support for nvme_cmd_copy.
Reviewed-by: Hannes Reinecke
Signed-off-by: Nitesh Shetty
Reinecke
Signed-off-by: Kanchan Joshi
Signed-off-by: Nitesh Shetty
Signed-off-by: Javier González
Signed-off-by: Anuj Gupta
---
drivers/nvme/host/constants.c | 1 +
drivers/nvme/host/core.c | 81 ++-
drivers/nvme/host/trace.c | 19
include/linux
: Nitesh Shetty
---
block/fops.c | 26 ++
1 file changed, 26 insertions(+)
diff --git a/block/fops.c b/block/fops.c
index 376265935714..5a4bba4f43aa 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
#include "
r both inode_in
and inode_out. Allow block device in generic_file_rw_checks.
Reviewed-by: Hannes Reinecke
Signed-off-by: Anuj Gupta
Signed-off-by: Nitesh Shetty
---
fs/read_write.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/read_write.c b/fs/read_write.c
nding destination.
At present in kernel user of emulation is fabrics.
Signed-off-by: Nitesh Shetty
Signed-off-by: Vincent Fu
Signed-off-by: Anuj Gupta
---
block/blk-lib.c| 223 +
include/linux/blkdev.h | 4 +
2 files changed, 227 insertions(+)
reason, if a request comes to the driver with only one of src/dst
bio, we fail the copy offload.
Larger copy will be divided, based on max_copy_sectors limit.
Reviewed-by: Hannes Reinecke
Signed-off-by: Anuj Gupta
Signed-off-by: Nitesh Shetty
---
block/blk-lib.c| 204
merge function.
Signed-off-by: Nitesh Shetty
Signed-off-by: Anuj Gupta
---
block/blk-core.c | 7 +++
block/blk-merge.c | 41 +++
block/blk.h | 16 +++
block/elevator.h | 1 +
include/linux/bio.h
-off-by: Nitesh Shetty
Signed-off-by: Kanchan Joshi
Signed-off-by: Anuj Gupta
---
Documentation/ABI/stable/sysfs-block | 23 +++
block/blk-settings.c | 34 --
block/blk-sysfs.c| 43
include/linux
94648.15614-1-nj.she...@samsung.com/
[1]
https://lore.kernel.org/linux-nvme/20231222061313.12260-1-nj.she...@samsung.com/
[2]
https://qemu-project.gitlab.io/qemu/system/devices/nvme.html#simple-copy
[3] https://github.com/nitesh-shetty/blktests/tree/feat/copy_offload/v19
[4
tracing.
Reviewed-by: Hannes Reinecke
Suggested-by: Damien Le Moal
Signed-off-by: Anuj Gupta
Signed-off-by: Nitesh Shetty
Signed-off-by: Vincent Fu
---
Documentation/block/null_blk.rst | 5 ++
drivers/block/null_blk/main.c | 97 ++-
drivers/block/null_blk
This is a prep patch to enable copy trace capability.
At present only zoned null_block is using trace, so we decoupled trace
and zoned dependency to make it usable in null_blk driver also.
Reviewed-by: Hannes Reinecke
Signed-off-by: Nitesh Shetty
Signed-off-by: Anuj Gupta
---
drivers/block
Setting copy_offload_supported flag to enable offload.
Reviewed-by: Hannes Reinecke
Signed-off-by: Nitesh Shetty
---
drivers/md/dm-linear.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c
index 2d3e186ca87e..cfec2fac28e1 100644
--- a/drivers
Before enabling copy for dm target, check if underlying devices and
dm target support copy. Avoid split happening inside dm target.
Fail early if the request needs split, currently splitting copy
request is not supported.
Signed-off-by: Nitesh Shetty
---
drivers/md/dm-table.c | 37
vfs_copy_file_range to service our request.
Currently target always shows copy capability by setting
NVME_CTRL_ONCS_COPY in controller ONCS.
loop target has copy support, which can be used to test copy offload.
trace event support for nvme_cmd_copy.
Reviewed-by: Hannes Reinecke
Signed-off-by: Nitesh Shetty
Reinecke
Signed-off-by: Kanchan Joshi
Signed-off-by: Nitesh Shetty
Signed-off-by: Javier González
Signed-off-by: Anuj Gupta
---
drivers/nvme/host/constants.c | 1 +
drivers/nvme/host/core.c | 79 +++
drivers/nvme/host/trace.c | 19 +
include/linux
: Nitesh Shetty
---
block/fops.c | 25 +
1 file changed, 25 insertions(+)
diff --git a/block/fops.c b/block/fops.c
index 0abaac705daf..6ca46ea1f358 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -747,6 +747,30 @@ static ssize_t blkdev_read_iter(struct kiocb *iocb, struct
r both inode_in
and inode_out. Allow block device in generic_file_rw_checks.
Reviewed-by: Hannes Reinecke
Signed-off-by: Anuj Gupta
Signed-off-by: Nitesh Shetty
---
fs/read_write.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/read_write.c b/fs/read_write.c
nding destination.
At present in kernel user of emulation is fabrics.
Signed-off-by: Nitesh Shetty
Signed-off-by: Vincent Fu
Signed-off-by: Anuj Gupta
---
block/blk-lib.c| 223 +
include/linux/blkdev.h | 4 +
2 files changed, 227 insertions(+)
reason, if a request comes to the driver with only one of src/dst
bio, we fail the copy offload.
Larger copy will be divided, based on max_copy_sectors limit.
Reviewed-by: Hannes Reinecke
Signed-off-by: Anuj Gupta
Signed-off-by: Nitesh Shetty
---
block/blk-lib.c| 204
merge function.
Signed-off-by: Nitesh Shetty
Signed-off-by: Anuj Gupta
---
block/blk-core.c | 7 +++
block/blk-merge.c | 41 +++
block/blk.h | 16 +++
block/elevator.h | 1 +
include/linux/bio.h
-by: Hannes Reinecke
Reviewed-by: Luis Chamberlain
Signed-off-by: Nitesh Shetty
Signed-off-by: Kanchan Joshi
Signed-off-by: Anuj Gupta
---
Documentation/ABI/stable/sysfs-block | 23 ++
block/blk-settings.c | 24 +++
block/blk-sysfs.c
20231206100253.13100-1-josh...@samsung.com/
[2]
https://qemu-project.gitlab.io/qemu/system/devices/nvme.html#simple-copy
[3] https://github.com/nitesh-shetty/blktests/tree/feat/copy_offload/v19
[4] https://github.com/OpenMPDK/fio/tree/copyoffload-3.35-v1
Q_OP_COPY_SRC = (__force blk_opf_t)19,
>>>
>>> Should this be an even numbered OP? The odd ones are for data
>>> WRITEs.
Our request opcode needs to be write based(even) so that while forming nvme-tcp
packets we send this as part of the nvme capsule.
But now I think this design can be simplified as you suggested, if we align
COPY_SRC to even and COPY_DST to odd. This requires us to change the design by
sending dst bio first hence forming a write based request, followed by
src bio's.
Will send a follow up series next week fixing this.
Thank you,
Nitesh Shetty
r both inode_in
and inode_out. Allow block device in generic_file_rw_checks.
Reviewed-by: Hannes Reinecke
Signed-off-by: Anuj Gupta
Signed-off-by: Nitesh Shetty
---
fs/read_write.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/read_write.c b/fs/read_write.c
: Nitesh Shetty
---
block/fops.c | 25 +
1 file changed, 25 insertions(+)
diff --git a/block/fops.c b/block/fops.c
index 73e42742543f..662d36a251a3 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -735,6 +735,30 @@ static ssize_t blkdev_read_iter(struct kiocb *iocb, struct
tracing.
Reviewed-by: Hannes Reinecke
Suggested-by: Damien Le Moal
Signed-off-by: Anuj Gupta
Signed-off-by: Nitesh Shetty
Signed-off-by: Vincent Fu
---
Documentation/block/null_blk.rst | 5 ++
drivers/block/null_blk/main.c | 97 ++-
drivers/block/null_blk
This is a prep patch to enable copy trace capability.
At present only zoned null_block is using trace, so we decoupled trace
and zoned dependency to make it usable in null_blk driver also.
Reviewed-by: Hannes Reinecke
Signed-off-by: Nitesh Shetty
Signed-off-by: Anuj Gupta
---
drivers/block
Setting copy_offload_supported flag to enable offload.
Reviewed-by: Hannes Reinecke
Signed-off-by: Nitesh Shetty
---
drivers/md/dm-linear.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c
index f4448d520ee9..1d1ee30bbefb 100644
--- a/drivers
Before enabling copy for dm target, check if underlying devices and
dm target support copy. Avoid split happening inside dm target.
Fail early if the request needs split, currently splitting copy
request is not supported.
Signed-off-by: Nitesh Shetty
---
drivers/md/dm-table.c | 37
vfs_copy_file_range to service our request.
Currently target always shows copy capability by setting
NVME_CTRL_ONCS_COPY in controller ONCS.
loop target has copy support, which can be used to test copy offload.
trace event support for nvme_cmd_copy.
Reviewed-by: Hannes Reinecke
Signed-off-by: Nitesh Shetty
Reinecke
Signed-off-by: Kanchan Joshi
Signed-off-by: Nitesh Shetty
Signed-off-by: Javier González
Signed-off-by: Anuj Gupta
---
drivers/nvme/host/constants.c | 1 +
drivers/nvme/host/core.c | 79 +++
drivers/nvme/host/trace.c | 19 +
include/linux
-by: Hannes Reinecke
Reviewed-by: Luis Chamberlain
Signed-off-by: Nitesh Shetty
Signed-off-by: Kanchan Joshi
Signed-off-by: Anuj Gupta
---
Documentation/ABI/stable/sysfs-block | 23 ++
block/blk-settings.c | 24 +++
block/blk-sysfs.c
merge function.
Signed-off-by: Nitesh Shetty
Signed-off-by: Anuj Gupta
---
block/blk-core.c | 7 +++
block/blk-merge.c | 41 +++
block/blk.h | 16 +++
block/elevator.h | 1 +
include/linux/bio.h
nding destination.
At present in kernel user of emulation is fabrics.
Signed-off-by: Nitesh Shetty
Signed-off-by: Vincent Fu
Signed-off-by: Anuj Gupta
---
block/blk-lib.c| 223 +
include/linux/blkdev.h | 4 +
2 files changed, 227 insertions(+)
reason, if a request comes to the driver with only one of src/dst
bio, we fail the copy offload.
Larger copy will be divided, based on max_copy_sectors limit.
Reviewed-by: Hannes Reinecke
Signed-off-by: Anuj Gupta
Signed-off-by: Nitesh Shetty
---
block/blk-lib.c| 204
20230920080756.11919-1-nj.she...@samsung.com/T/#t
[2]
https://qemu-project.gitlab.io/qemu/system/devices/nvme.html#simple-copy
[3] https://github.com/nitesh-shetty/blktests/tree/feat/copy_offload/v15
[4] https://github.com/OpenMPDK/fio/tree/copyoffload-3.35-v1
69 matches
Mail list logo