Re: [PATCH] Revert "nvme: cleanup zone information initialization"

2021-03-08 Thread Kanchan Joshi
On Mon, Mar 8, 2021 at 4:21 PM Niklas Cassel wrote: > > From: Niklas Cassel > > This reverts commit 73d90386b559d6f4c3c5db5e6bb1b68aae8fd3e7. > > Commit 73d90386b559 ("nvme: cleanup zone information initialization") > introduced the following warning at boot: > WARNING: CPU: 0 PID: 7 at

Re: [RFC PATCH 0/4] Asynchronous passthrough ioctl

2021-02-22 Thread Kanchan Joshi
On Mon, Feb 22, 2021 at 8:03 PM Jens Axboe wrote: > > On 2/22/21 6:42 AM, Kanchan Joshi wrote: > > On Thu, Jan 28, 2021 at 10:54 PM Jens Axboe wrote: > >> > >> On 1/28/21 10:13 AM, Kanchan Joshi wrote: > >>> On Thu, Jan 28, 2021 at 8:08 PM Jens Axbo

Re: [RFC PATCH 0/4] Asynchronous passthrough ioctl

2021-02-22 Thread Kanchan Joshi
On Thu, Jan 28, 2021 at 10:54 PM Jens Axboe wrote: > > On 1/28/21 10:13 AM, Kanchan Joshi wrote: > > On Thu, Jan 28, 2021 at 8:08 PM Jens Axboe wrote: > >> > >> On 1/28/21 5:04 AM, Kanchan Joshi wrote: > >>> On Wed, Jan 27, 2021 at 9:32 PM Pavel Begu

Re: [RFC PATCH 0/4] Asynchronous passthrough ioctl

2021-01-28 Thread Kanchan Joshi
On Thu, Jan 28, 2021 at 8:20 PM Jens Axboe wrote: > > On 1/28/21 5:04 AM, Kanchan Joshi wrote: > > And for some ioctls, driver may still need to use task-work to update > > the user-space pointers (embedded in uring/ioctl cmd) during > > completion. > > For t

Re: [RFC PATCH 0/4] Asynchronous passthrough ioctl

2021-01-28 Thread Kanchan Joshi
On Thu, Jan 28, 2021 at 8:08 PM Jens Axboe wrote: > > On 1/28/21 5:04 AM, Kanchan Joshi wrote: > > On Wed, Jan 27, 2021 at 9:32 PM Pavel Begunkov > > wrote: > >> > >> On 27/01/2021 15:42, Pavel Begunkov wrote: > >>> On 27/01/2021 15:00, Ka

Re: [RFC PATCH 0/4] Asynchronous passthrough ioctl

2021-01-28 Thread Kanchan Joshi
On Wed, Jan 27, 2021 at 9:32 PM Pavel Begunkov wrote: > > On 27/01/2021 15:42, Pavel Begunkov wrote: > > On 27/01/2021 15:00, Kanchan Joshi wrote: > >> This RFC patchset adds asynchronous ioctl capability for NVMe devices. > >> Purpose of RFC is to get the

[RFC PATCH 2/4] kernel: export task_work_add

2021-01-27 Thread Kanchan Joshi
Task-work infra is required to introduce async-ioctl in nvme driver. Without this being exported, NVMe needs to be built statically. Signed-off-by: Kanchan Joshi --- kernel/task_work.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/task_work.c b/kernel/task_work.c

[RFC PATCH 1/4] block: introduce async ioctl operation

2021-01-27 Thread Kanchan Joshi
Add a new block-dev operation for async-ioctl. Driver managing the block-dev can choose to implement it. Signed-off-by: Kanchan Joshi --- include/linux/blkdev.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index f94ee3089e01

[RFC PATCH 3/4] nvme: add async ioctl support

2021-01-27 Thread Kanchan Joshi
-task. For such ioctl, nvme-completion schedules a task-work which first updates ioctl-specific buffers/fields and after that invokes the ioctl-completion handler. Signed-off-by: Kanchan Joshi Signed-off-by: Anuj Gupta --- drivers/nvme/host/core.c | 347 +++ 1

[RFC PATCH 4/4] io_uring: add async passthrough ioctl support

2021-01-27 Thread Kanchan Joshi
that case CQE is updated on the fly. For asynchronous update, lower-layer calls the completion-callback supplied by io-uring. Signed-off-by: Kanchan Joshi Signed-off-by: Anuj Gupta --- fs/io_uring.c | 77 +++ include/uapi/linux/io_uring.h | 7 +++

[RFC PATCH 0/4] Asynchronous passthrough ioctl

2021-01-27 Thread Kanchan Joshi
ing, ); printf("ioctl result =%d\n", cqe->res) } Kanchan Joshi (4): block: introduce async ioctl operation kernel: export task_work_add nvme: add async ioctl support io_uring: add async passthrough ioctl support drivers/nvme/host/core.c | 347 ++

Re: [PATCH v4 6/6] io_uring: add support for zone-append

2020-09-29 Thread Kanchan Joshi
On Tue, Sep 29, 2020 at 6:54 AM Damien Le Moal wrote: > > On 2020/09/29 3:58, Kanchan Joshi wrote: > [...] > > ZoneFS is better when it is about dealing at single-zone granularity, > > and direct-block seems better when it is about grouping zones (in > > vari

Re: [PATCH v4 6/6] io_uring: add support for zone-append

2020-09-28 Thread Kanchan Joshi
On Fri, Sep 25, 2020 at 8:22 AM Damien Le Moal wrote: > > On 2020/09/25 2:20, Kanchan Joshi wrote: > > On Tue, Sep 8, 2020 at 8:48 PM h...@infradead.org > > wrote: > >> > >> On Mon, Sep 07, 2020 at 12:31:42PM +0530, Kanchan Joshi wrote: > >>

Re: [PATCH v2 0/1] concurrency handling for zoned null-blk

2020-09-28 Thread Kanchan Joshi
On Mon, Sep 28, 2020 at 5:42 PM Greg KH wrote: > > On Mon, Sep 28, 2020 at 03:25:48PM +0530, Kanchan Joshi wrote: > > Changes since v1: > > - applied the refactoring suggested by Damien > > > > Kanchan Joshi (1): > > null_blk: synchronization fix for

[PATCH v2 0/1] concurrency handling for zoned null-blk

2020-09-28 Thread Kanchan Joshi
Changes since v1: - applied the refactoring suggested by Damien Kanchan Joshi (1): null_blk: synchronization fix for zoned device drivers/block/null_blk.h | 1 + drivers/block/null_blk_zoned.c | 22 ++ 2 files changed, 19 insertions(+), 4 deletions(-) -- 2.25.1

[PATCH v2 1/1] null_blk: synchronization fix for zoned device

2020-09-28 Thread Kanchan Joshi
("null_blk: Support REQ_OP_ZONE_APPEND") Signed-off-by: Kanchan Joshi --- drivers/block/null_blk.h | 1 + drivers/block/null_blk_zoned.c | 22 ++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/block/null_blk.h b/drivers/block/null_b

Re: [PATCH] null_blk: synchronization fix for zoned device

2020-09-24 Thread Kanchan Joshi
Thanks for the review. I'll apply this feedback in V2. On Thu, Sep 24, 2020 at 2:13 PM Damien Le Moal wrote: > > On 2020/09/24 15:26, Kanchan Joshi wrote: > > Parallel write,read,zone-mgmt operations accessing/altering zone state > > and write-pointer may get into race. A

Re: [PATCH v4 6/6] io_uring: add support for zone-append

2020-09-24 Thread Kanchan Joshi
On Tue, Sep 8, 2020 at 8:48 PM h...@infradead.org wrote: > > On Mon, Sep 07, 2020 at 12:31:42PM +0530, Kanchan Joshi wrote: > > But there are use-cases which benefit from supporting zone-append on > > raw block-dev path. > > Certain user-space log-structured/cow F

[PATCH] null_blk: synchronization fix for zoned device

2020-09-24 Thread Kanchan Joshi
Parallel write,read,zone-mgmt operations accessing/altering zone state and write-pointer may get into race. Avoid the situation by using a new spinlock for zoned device. Concurrent zone-appends (on a zone) returning same write-pointer issue is also avoided using this lock. Signed-off-by: Kanchan

Re: [PATCH 1/2] nvme: set io-scheduler requirement for ZNS

2020-09-07 Thread Kanchan Joshi
On Mon, Sep 7, 2020 at 5:07 PM Damien Le Moal wrote: > > On 2020/09/07 20:24, Kanchan Joshi wrote: > > On Mon, Sep 7, 2020 at 1:52 PM Damien Le Moal wrote: > >> > >> On 2020/09/07 16:01, Kanchan Joshi wrote: > >>>> Even for SMR, the us

Re: [PATCH 1/2] nvme: set io-scheduler requirement for ZNS

2020-09-07 Thread Kanchan Joshi
On Mon, Sep 7, 2020 at 1:52 PM Damien Le Moal wrote: > > On 2020/09/07 16:01, Kanchan Joshi wrote: > >> Even for SMR, the user is free to set the elevator to none, which disables > >> zone > >> write locking. Issuing writes correctly then becomes the responsibil

Re: [PATCH v4 6/6] io_uring: add support for zone-append

2020-09-07 Thread Kanchan Joshi
On Fri, Aug 14, 2020 at 1:44 PM h...@infradead.org wrote: > > On Wed, Aug 05, 2020 at 07:35:28AM +, Damien Le Moal wrote: > > > the write pointer. The only interesting addition is that we also want > > > to report where we wrote. So I'd rather have RWF_REPORT_OFFSET or so. > > > > That

Re: [PATCH 1/2] nvme: set io-scheduler requirement for ZNS

2020-09-07 Thread Kanchan Joshi
On Wed, Aug 19, 2020 at 4:47 PM Damien Le Moal wrote: > > On 2020/08/19 19:32, Kanchan Joshi wrote: > > On Wed, Aug 19, 2020 at 3:08 PM Damien Le Moal > > wrote: > >> > >> On 2020/08/19 18:27, Kanchan Joshi wrote: > >>> On Tue, A

Re: [PATCH 2/2] nvme: add emulation for zone-append

2020-08-20 Thread Kanchan Joshi
On Thu, Aug 20, 2020 at 3:22 AM Keith Busch wrote: > > On Wed, Aug 19, 2020 at 01:11:58PM -0600, David Fugate wrote: > > Intel does not support making *optional* NVMe spec features *required* > > by the NVMe driver. > > This is inaccurate. As another example, the spec optionally allows a > zone

Re: [PATCH 1/2] nvme: set io-scheduler requirement for ZNS

2020-08-19 Thread Kanchan Joshi
On Wed, Aug 19, 2020 at 3:08 PM Damien Le Moal wrote: > > On 2020/08/19 18:27, Kanchan Joshi wrote: > > On Tue, Aug 18, 2020 at 12:46 PM Christoph Hellwig wrote: > >> > >> On Tue, Aug 18, 2020 at 10:59:35AM +0530, Kanchan Joshi wrote: > >>> Set elevator

Re: [PATCH 1/2] nvme: set io-scheduler requirement for ZNS

2020-08-19 Thread Kanchan Joshi
On Tue, Aug 18, 2020 at 12:46 PM Christoph Hellwig wrote: > > On Tue, Aug 18, 2020 at 10:59:35AM +0530, Kanchan Joshi wrote: > > Set elevator feature ELEVATOR_F_ZBD_SEQ_WRITE required for ZNS. > > No, it is not. Are you saying MQ-Deadline (write-lock) is not needed for wr

[PATCH 1/2] nvme: set io-scheduler requirement for ZNS

2020-08-17 Thread Kanchan Joshi
Set elevator feature ELEVATOR_F_ZBD_SEQ_WRITE required for ZNS. Signed-off-by: Kanchan Joshi --- drivers/nvme/host/zns.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/zns.c b/drivers/nvme/host/zns.c index 57cfd78731fb..cabd870fb64e 100644 --- a/drivers/nvme/host/zns.c

[PATCH 0/2] enable append-emulation for ZNS

2020-08-17 Thread Kanchan Joshi
Currently NVMe driver rejects the ZNS device if zone-append is not supported natively. Make it accept the device and activate append-emulation instead. This is mostly borrowed from SCSI emulation. The other patch enforces a zone-friendly I/O scheduler for ZNS. Kanchan Joshi (2): nvme: set io

[PATCH 2/2] nvme: add emulation for zone-append

2020-08-17 Thread Kanchan Joshi
position, block-layer is asked to retry it. Signed-off-by: Kanchan Joshi Signed-off-by: Nitesh Shetty Signed-off-by: SelvaKumar S Signed-off-by: Javier Gonzalez --- drivers/nvme/host/core.c | 41 +- drivers/nvme/host/nvme.h | 60 drivers/nvme/host/zns.c | 306

Re: [PATCH v4 6/6] io_uring: add support for zone-append

2020-07-31 Thread Kanchan Joshi
On Fri, Jul 31, 2020 at 6:38 PM h...@infradead.org wrote: > > And FYI, this is what I'd do for a hacky aio-only prototype (untested): > > > diff --git a/fs/aio.c b/fs/aio.c > index 91e7cc4a9f179b..42b1934e38758b 100644 > --- a/fs/aio.c > +++ b/fs/aio.c > @@ -1438,7 +1438,10 @@ static void

Re: [PATCH v4 6/6] io_uring: add support for zone-append

2020-07-31 Thread Kanchan Joshi
On Fri, Jul 31, 2020 at 1:44 PM Damien Le Moal wrote: > > On 2020/07/31 16:59, Kanchan Joshi wrote: > > On Fri, Jul 31, 2020 at 12:29 PM Damien Le Moal > > wrote: > >> > >> On 2020/07/31 15:45, h...@infradead.org wrote: > >>> On Fri, Jul 31

Re: [PATCH v4 6/6] io_uring: add support for zone-append

2020-07-31 Thread Kanchan Joshi
On Fri, Jul 31, 2020 at 12:29 PM Damien Le Moal wrote: > > On 2020/07/31 15:45, h...@infradead.org wrote: > > On Fri, Jul 31, 2020 at 06:42:10AM +, Damien Le Moal wrote: > >>> - We may not be able to use RWF_APPEND, and need exposing a new > >>> type/flag (RWF_INDIRECT_OFFSET etc.)

Re: [PATCH v4 6/6] io_uring: add support for zone-append

2020-07-31 Thread Kanchan Joshi
On Fri, Jul 31, 2020 at 12:12 PM Damien Le Moal wrote: > > On 2020/07/31 3:26, Kanchan Joshi wrote: > > On Thu, Jul 30, 2020 at 11:24 PM Jens Axboe wrote: > >> > >> On 7/30/20 11:51 AM, Kanchan Joshi wrote: > >>> On Thu, Jul 30, 2020 at 11:10 PM Pavel B

Re: [PATCH v4 6/6] io_uring: add support for zone-append

2020-07-30 Thread Kanchan Joshi
On Thu, Jul 30, 2020 at 11:24 PM Jens Axboe wrote: > > On 7/30/20 11:51 AM, Kanchan Joshi wrote: > > On Thu, Jul 30, 2020 at 11:10 PM Pavel Begunkov > > wrote: > >> > >> On 30/07/2020 20:16, Jens Axboe wrote: > >>> On 7/30/20 10:26 AM, Pavel

Re: [PATCH v4 6/6] io_uring: add support for zone-append

2020-07-30 Thread Kanchan Joshi
27/07/2020 23:34, Jens Axboe wrote: > >>>>> On 7/27/20 1:16 PM, Kanchan Joshi wrote: > >>>>>> On Fri, Jul 24, 2020 at 10:00 PM Jens Axboe wrote: > >>>>>>> > >>>>>>> On 7/24/20 9:49 AM, Kanchan Joshi wrote: > &g

Re: [PATCH v4 6/6] io_uring: add support for zone-append

2020-07-27 Thread Kanchan Joshi
On Fri, Jul 24, 2020 at 10:00 PM Jens Axboe wrote: > > On 7/24/20 9:49 AM, Kanchan Joshi wrote: > > diff --git a/fs/io_uring.c b/fs/io_uring.c > > index 7809ab2..6510cf5 100644 > > --- a/fs/io_uring.c > > +++ b/fs/io_uring.c > > @@ -1284,8 +1301,15 @@ stati

[PATCH v4 3/6] uio: return status with iov truncation

2020-07-24 Thread Kanchan Joshi
From: SelvaKumar S Make iov_iter_truncate to report whether it actually truncated. This helps callers which want to process the iov_iter in its entirety. Signed-off-by: SelvaKumar S Signed-off-by: Kanchan Joshi Signed-off-by: Nitesh Shetty Signed-off-by: Javier Gonzalez --- include/linux

[PATCH v4 6/6] io_uring: add support for zone-append

2020-07-24 Thread Kanchan Joshi
rt number-of-bytes-copied. append-offset is returned by lower-layer to io-uring via ret2 of ki_complete interface. Make changes to collect it and send to user-space via cqe->res64. Signed-off-by: SelvaKumar S Signed-off-by: Kanchan Joshi Signed-off-by: Nitesh Shetty Signed-off-by: Jav

[PATCH v4 5/6] block: enable zone-append for iov_iter of bvec type

2020-07-24 Thread Kanchan Joshi
zone-append with bvec iov_iter gives WARN_ON, and returns -EINVAL. Add new helper to process such iov_iter and add pages in bio honoring zone-append specific constraints. This is used to enable zone-append with io-uring fixed-buffer. Signed-off-by: Kanchan Joshi Signed-off-by: Selvakumar S

[PATCH v4 4/6] block: add zone append handling for direct I/O path

2020-07-24 Thread Kanchan Joshi
ite with the flag IOCB_ZONE_APPEND are ensured not be be short. Prevent short write and instead return failure if appending write spans beyond end of device. Return failure if write is larger than max_append_limit and therefore requires formation of multiple bios. Signed-off-by: Kanchan Joshi Signed-

[PATCH v4 2/6] fs: change ki_complete interface to support 64bit ret2

2020-07-24 Thread Kanchan Joshi
From: SelvaKumar S kiocb->ki_complete(...,long ret2) - change ret2 to long long. This becomes handy to return 64bit written-offset with appending write. Change callers using ki_complete prototype. Signed-off-by: SelvaKumar S Signed-off-by: Kanchan Joshi Signed-off-by: Nitesh Shetty Sig

[PATCH v4 0/6] zone-append support in io-uring and aio

2020-07-24 Thread Kanchan Joshi
s ensured not to be a short-write. Kanchan Joshi (3): fs: introduce FMODE_ZONE_APPEND and IOCB_ZONE_APPEND block: add zone append handling for direct I/O path block: enable zone-append for iov_iter of bvec type SelvaKumar S (3): fs: change ki_complete interface to support 64bit ret2 uio: return status

[PATCH v4 1/6] fs: introduce FMODE_ZONE_APPEND and IOCB_ZONE_APPEND

2020-07-24 Thread Kanchan Joshi
in, and receives write that meets file-append criteria (RWF_APPEND write or O_APPEND open), set IOCB_ZONE_APPEND in kiocb->ki_flag, apart from existing IOCB_APPEND. IOCB_ZONE_APPEND is meant to isolate the code that returns written-location with appending write. Signed-off-by: Kanchan Joshi Signed-

Re: [PATCH v2] Fix zone-append error code

2020-07-21 Thread Kanchan Joshi
Hi Jens, Is this fine to be picked? On Mon, Jul 6, 2020 at 1:06 AM Kanchan Joshi wrote: > > Changes since v1: > - updated commit description > - added reviewed-by > > Kanchan Joshi (1): > block: fix error code for zone-append > > block/bio.c | 2 +- > 1 f

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-20 Thread Kanchan Joshi
On Mon, Jul 20, 2020 at 10:44 PM Matthew Wilcox wrote: > > On Mon, Jul 20, 2020 at 10:19:57PM +0530, Kanchan Joshi wrote: > > On Fri, Jul 10, 2020 at 7:41 PM Kanchan Joshi wrote: > > > If we are doing this for zone-append (and not general cases), "__s64 > > >

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-20 Thread Kanchan Joshi
On Fri, Jul 10, 2020 at 7:13 PM Christoph Hellwig wrote: > > On Fri, Jul 10, 2020 at 06:59:45PM +0530, Kanchan Joshi wrote: > > > block doesn't work for the case of writes to files that don't have > > > to be aligned in any way. And that I think is the more broadly > &

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-20 Thread Kanchan Joshi
On Fri, Jul 10, 2020 at 7:41 PM Kanchan Joshi wrote: > > On Fri, Jul 10, 2020 at 7:21 PM Matthew Wilcox wrote: > > > > On Fri, Jul 10, 2020 at 02:49:32PM +0100, Christoph Hellwig wrote: > > > On Fri, Jul 10, 2020 at 02:48:24PM +0100, Matthew Wilcox wrote: > > &

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-20 Thread Kanchan Joshi
On Fri, Jul 10, 2020 at 7:39 PM Jens Axboe wrote: > > On 7/10/20 7:10 AM, Christoph Hellwig wrote: > > On Fri, Jul 10, 2020 at 12:35:43AM +0530, Kanchan Joshi wrote: > >> Append required special treatment (conversion for sector to bytes) for > >> io_uring. > >

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-10 Thread Kanchan Joshi
On Fri, Jul 10, 2020 at 7:21 PM Matthew Wilcox wrote: > > On Fri, Jul 10, 2020 at 02:49:32PM +0100, Christoph Hellwig wrote: > > On Fri, Jul 10, 2020 at 02:48:24PM +0100, Matthew Wilcox wrote: > > > If we're going to go the route of changing the CQE, how about: > > > > > > struct io_uring_cqe {

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-10 Thread Kanchan Joshi
On Fri, Jul 10, 2020 at 6:59 PM Kanchan Joshi wrote: > > On Fri, Jul 10, 2020 at 6:39 PM Christoph Hellwig wrote: > > > > On Thu, Jul 09, 2020 at 12:50:27PM -0600, Jens Axboe wrote: > > > It might, if you have IRQ context for the completion. task_work isn't >

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-10 Thread Kanchan Joshi
On Fri, Jul 10, 2020 at 6:39 PM Christoph Hellwig wrote: > > On Thu, Jul 09, 2020 at 12:50:27PM -0600, Jens Axboe wrote: > > It might, if you have IRQ context for the completion. task_work isn't > > expensive, however. It's not like a thread offload. > > > > > Using flags have not been liked

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-09 Thread Kanchan Joshi
On Fri, Jul 10, 2020 at 12:20 AM Jens Axboe wrote: > > On 7/9/20 12:36 PM, Kanchan Joshi wrote: > > On Thu, Jul 9, 2020 at 7:36 PM Jens Axboe wrote: > >> > >> On 7/9/20 8:00 AM, Christoph Hellwig wrote: > >>> On Thu, Jul 09, 2020 at 07:58:04AM -0600, J

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-09 Thread Kanchan Joshi
On Thu, Jul 9, 2020 at 7:36 PM Jens Axboe wrote: > > On 7/9/20 8:00 AM, Christoph Hellwig wrote: > > On Thu, Jul 09, 2020 at 07:58:04AM -0600, Jens Axboe wrote: > >>> We don't actually need any new field at all. By the time the write > >>> returned ki_pos contains the offset after the write, and

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-08 Thread Kanchan Joshi
On Wed, Jul 08, 2020 at 03:22:51PM +0100, Matthew Wilcox wrote: On Wed, Jul 08, 2020 at 06:28:05PM +0530, Kanchan Joshi wrote: The last thing is about the flag used to trigger this processing. Will it be fine to intoduce new flag (RWF_APPEND2 or RWF_APPEND_OFFSET) instead of using RWF_APPEND

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-08 Thread Kanchan Joshi
On Wed, Jul 08, 2020 at 10:38:44AM -0600, Jens Axboe wrote: On 7/8/20 10:33 AM, Matthew Wilcox wrote: On Wed, Jul 08, 2020 at 06:08:12PM +0200, Javier González wrote: I just wanted to get clarification there, because to me it sounded like you expected Kanchan to do it, and Kanchan assuming it

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-08 Thread Kanchan Joshi
On Tue, Jul 07, 2020 at 04:37:55PM -0600, Jens Axboe wrote: On 7/7/20 4:18 PM, Matthew Wilcox wrote: On Tue, Jul 07, 2020 at 02:40:06PM -0600, Jens Axboe wrote: so we have another 24 bytes before io_kiocb takes up another cacheline. If that's a serious problem, I have an idea about how to

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-07 Thread Kanchan Joshi
On Tue, Jul 07, 2020 at 04:52:37PM +0100, Matthew Wilcox wrote: On Tue, Jul 07, 2020 at 08:41:05PM +0530, Kanchan Joshi wrote: On Mon, Jul 06, 2020 at 03:32:08PM +0100, Matthew Wilcox wrote: > On Mon, Jul 06, 2020 at 08:27:17AM -0600, Jens Axboe wrote: > > On 7/6/20 8:10 AM, Matth

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-07 Thread Kanchan Joshi
Sun, Jul 05, 2020 at 03:00:47PM -0600, Jens Axboe wrote: >>>> On 7/5/20 12:47 PM, Kanchan Joshi wrote: >>>>> From: Selvakumar S >>>>> >>>>> For zone-append, block-layer will return zone-relative offset via ret2 >>>>> of ki_com

Re: [PATCH v3 4/4] io_uring: add support for zone-append

2020-07-06 Thread Kanchan Joshi
On Sun, Jul 05, 2020 at 03:00:47PM -0600, Jens Axboe wrote: On 7/5/20 12:47 PM, Kanchan Joshi wrote: From: Selvakumar S For zone-append, block-layer will return zone-relative offset via ret2 of ki_complete interface. Make changes to collect it, and send to user-space using cqe->flags. Sig

[PATCH v2] Fix zone-append error code

2020-07-05 Thread Kanchan Joshi
Changes since v1: - updated commit description - added reviewed-by Kanchan Joshi (1): block: fix error code for zone-append block/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4

[PATCH v2] block: fix error code for zone-append

2020-07-05 Thread Kanchan Joshi
Avoid returning success when max_append_sectors is zero. This prevents infinite loop in bio_iov_iter_get_pages(). Signed-off-by: Kanchan Joshi Signed-off-by: Selvakumar S Signed-off-by: Nitesh Shetty Signed-off-by: Javier Gonzalez Reviewed-by: Damien Le Moal --- block/bio.c | 2 +- 1 file

[PATCH v3 1/4] fs: introduce FMODE_ZONE_APPEND and IOCB_ZONE_APPEND

2020-07-05 Thread Kanchan Joshi
a file is opened, it can subscribe to zone-append by setting FMODE_ZONE_APPEND. Add IOCB_ZONE_APPEND which is set in kiocb->ki_flags if write meets existing file-append critera, and file has subscribed to zone-append. Signed-off-by: Selvakumar S Signed-off-by: Kanchan Joshi Signed-off-by: Nit

[PATCH v3 4/4] io_uring: add support for zone-append

2020-07-05 Thread Kanchan Joshi
From: Selvakumar S For zone-append, block-layer will return zone-relative offset via ret2 of ki_complete interface. Make changes to collect it, and send to user-space using cqe->flags. Signed-off-by: Selvakumar S Signed-off-by: Kanchan Joshi Signed-off-by: Nitesh Shetty Signed-off-by: Jav

[PATCH v3 3/4] block: enable zone-append for iov_iter of bvec type

2020-07-05 Thread Kanchan Joshi
zone-append with bvec iov_iter gives WARN_ON, and returns -EINVAL. Add new helper to process such iov_iter and add pages in bio honoring zone-append specific constraints. This is used to enable zone-append with io-uring fixed-buffer. Signed-off-by: Kanchan Joshi Signed-off-by: Selvakumar S

[PATCH v3 2/4] block: add zone append handling for direct I/O path

2020-07-05 Thread Kanchan Joshi
->ki_complete interface. Return failure if write is larger than max_append_limit and therefore requires formation of multiple bios. Signed-off-by: Selvakumar S Signed-off-by: Kanchan Joshi Signed-off-by: Nitesh Shetty Signed-off-by: Arnav Dawn Signed-off-by: Javier Gonzalez --- fs/block_dev.c |

[PATCH v3 0/4] zone-append support in io-uring and aio

2020-07-05 Thread Kanchan Joshi
y. Patchset picks option #1. Kanchan Joshi (2): fs: introduce FMODE_ZONE_APPEND and IOCB_ZONE_APPEND block: enable zone-append for iov_iter of bvec type Selvakumar S (2): block: add zone append handling for direct I/O path io_uring: add support for zone-append block

Re: [PATCH 2/2] block: enable zone-append for iov_iter of bvec type

2020-07-03 Thread Kanchan Joshi
On Fri, Jul 03, 2020 at 05:32:56AM +, Damien Le Moal wrote: On 2020/07/03 0:42, Kanchan Joshi wrote: zone-append with bvec iov_iter gives WARN_ON, and returns -EINVAL. Add new helper to process such iov_iter and add pages in bio honoring zone-append specific constraints. Signed-off

Re: [PATCH 1/2] block: fix error code for zone-append

2020-07-03 Thread Kanchan Joshi
On Fri, Jul 03, 2020 at 05:29:50AM +, Damien Le Moal wrote: On 2020/07/03 0:42, Kanchan Joshi wrote: avoid returning success when it should report failure, preventing odd behavior in caller. You can be more precise here: the odd behavior is an infinite loop in bio_iov_iter_get_pages

[PATCH 2/2] block: enable zone-append for iov_iter of bvec type

2020-07-02 Thread Kanchan Joshi
zone-append with bvec iov_iter gives WARN_ON, and returns -EINVAL. Add new helper to process such iov_iter and add pages in bio honoring zone-append specific constraints. Signed-off-by: Kanchan Joshi Signed-off-by: Selvakumar S Signed-off-by: Nitesh Shetty Signed-off-by: Javier Gonzalez

[PATCH 1/2] block: fix error code for zone-append

2020-07-02 Thread Kanchan Joshi
avoid returning success when it should report failure, preventing odd behavior in caller. Signed-off-by: Kanchan Joshi Signed-off-by: Selvakumar S Signed-off-by: Nitesh Shetty Signed-off-by: Javier Gonzalez --- block/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 0/2] fix/extend zone-append in block-layer

2020-07-02 Thread Kanchan Joshi
() but takes zone-append limits into account. Kanchan Joshi (2): block: fix error code for zone-append block: enable zone-append for iov_iter of bvec type block/bio.c | 33 + 1 file changed, 29 insertions(+), 4 deletions(-) -- 2.7.4

Re: [PATCH v2 1/2] fs,block: Introduce RWF_ZONE_APPEND and handling in direct IO path

2020-06-30 Thread Kanchan Joshi
On Tue, Jun 30, 2020 at 07:56:46AM +, Damien Le Moal wrote: On 2020/06/30 16:53, Damien Le Moal wrote: On 2020/06/30 16:43, Kanchan Joshi wrote: On Tue, Jun 30, 2020 at 12:37:07AM +, Damien Le Moal wrote: On 2020/06/30 3:35, Kanchan Joshi wrote: On Fri, Jun 26, 2020 at 02:50:20AM

Re: [PATCH v2 1/2] fs,block: Introduce RWF_ZONE_APPEND and handling in direct IO path

2020-06-30 Thread Kanchan Joshi
On Tue, Jun 30, 2020 at 12:37:07AM +, Damien Le Moal wrote: On 2020/06/30 3:35, Kanchan Joshi wrote: On Fri, Jun 26, 2020 at 02:50:20AM +, Damien Le Moal wrote: On 2020/06/26 2:18, Kanchan Joshi wrote: Introduce RWF_ZONE_APPEND flag to represent zone-append. User-space sends

Re: [PATCH v2 1/2] fs,block: Introduce RWF_ZONE_APPEND and handling in direct IO path

2020-06-29 Thread Kanchan Joshi
On Fri, Jun 26, 2020 at 02:50:20AM +, Damien Le Moal wrote: On 2020/06/26 2:18, Kanchan Joshi wrote: Introduce RWF_ZONE_APPEND flag to represent zone-append. User-space sends this with write. Add IOCB_ZONE_APPEND which is set in kiocb->ki_flags on receiving RWF_ZONE_APPEND. Make direct

Re: [PATCH v2 0/2] zone-append support in io-uring and aio

2020-06-26 Thread Kanchan Joshi
On Fri, Jun 26, 2020 at 03:11:55AM +, Damien Le Moal wrote: On 2020/06/26 2:18, Kanchan Joshi wrote: Semantics ---> Zone-append, by its nature, may perform write on a different location than what was specified. It does not fit into POSIX, and trying to fit may just undermine its bene

Re: [PATCH v2 1/2] fs,block: Introduce RWF_ZONE_APPEND and handling in direct IO path

2020-06-26 Thread Kanchan Joshi
written for O_APPEND writes totally makes sense, and actually is generalizable to all files. Together with zonefs that gives you a perfect interface for zone append. On Thu, Jun 25, 2020 at 10:45:48PM +0530, Kanchan Joshi wrote: Introduce RWF_ZONE_APPEND flag to represent zone-append

[PATCH v2 0/2] zone-append support in io-uring and aio

2020-06-25 Thread Kanchan Joshi
. - linux-aio changes vanish because of no new opcode - Fixed the overflow and other issues mentioned by Damien - Simplified uring support code, fixed the issues mentioned by Pavel - Added error checks Kanchan Joshi (1): fs,block: Introduce RWF_ZONE_APPEND and handling in direct IO path Selvaku

[PATCH v2 2/2] io_uring: add support for zone-append

2020-06-25 Thread Kanchan Joshi
r S Signed-off-by: Kanchan Joshi Signed-off-by: Nitesh Shetty Signed-off-by: Javier Gonzalez --- fs/io_uring.c | 32 ++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 155f3d8..31a9da58 100644 --- a/fs/io_uring.c +++ b

[PATCH v2 1/2] fs,block: Introduce RWF_ZONE_APPEND and handling in direct IO path

2020-06-25 Thread Kanchan Joshi
ive offset, in sector unit, to upper layer using kiocb->ki_complete interface. Report error if zone-append is requested on regular file or on sync kiocb (i.e. one without ki_complete). Signed-off-by: Kanchan Joshi Signed-off-by: SelvaKumar S Signed-off-by: Arnav Dawn Signed-off-by: Nitesh

Re: [PATCH 0/3] zone-append support in aio and io-uring

2020-06-18 Thread Kanchan Joshi
On Thu, Jun 18, 2020 at 10:04:32AM +0200, Matias Bjørling wrote: On 17/06/2020 19.23, Kanchan Joshi wrote: This patchset enables issuing zone-append using aio and io-uring direct-io interface. For aio, this introduces opcode IOCB_CMD_ZONE_APPEND. Application uses start LBA of the zone

Re: [PATCH 1/3] fs,block: Introduce IOCB_ZONE_APPEND and direct-io handling

2020-06-18 Thread Kanchan Joshi
On Thu, Jun 18, 2020 at 07:16:19AM +, Damien Le Moal wrote: On 2020/06/18 2:27, Kanchan Joshi wrote: From: Selvakumar S Introduce IOCB_ZONE_APPEND flag, which is set in kiocb->ki_flags for zone-append. Direct I/O submission path uses this flag to send bio with append op. And complet

Re: [PATCH 0/3] zone-append support in aio and io-uring

2020-06-18 Thread Kanchan Joshi
On Wed, Jun 17, 2020 at 11:56:34PM -0700, Christoph Hellwig wrote: On Wed, Jun 17, 2020 at 10:53:36PM +0530, Kanchan Joshi wrote: This patchset enables issuing zone-append using aio and io-uring direct-io interface. For aio, this introduces opcode IOCB_CMD_ZONE_APPEND. Application uses start

[PATCH 2/3] aio: add support for zone-append

2020-06-17 Thread Kanchan Joshi
Introduce IOCB_CMD_ZONE_APPEND opcode for zone-append. On append completion zone-relative offset is returned using io_event->res2. Signed-off-by: Kanchan Joshi Signed-off-by: Arnav Dawn Signed-off-by: SelvaKumar S Signed-off-by: Nitesh Shetty Signed-off-by: Javier Gonzalez --- fs/ai

[PATCH 3/3] io_uring: add support for zone-append

2020-06-17 Thread Kanchan Joshi
ags to return zone-relative offset. Signed-off-by: SelvaKumar S Signed-off-by: Kanchan Joshi Signed-off-by: Nitesh Shetty Signed-off-by: Javier Gonzalez --- fs/io_uring.c | 72 +-- include/uapi/linux/io_uring.h | 8 - 2 files changed,

[PATCH 1/3] fs,block: Introduce IOCB_ZONE_APPEND and direct-io handling

2020-06-17 Thread Kanchan Joshi
off-by: Kanchan Joshi Signed-off-by: Nitesh Shetty Signed-off-by: Javier Gonzalez --- fs/block_dev.c | 19 ++- include/linux/fs.h | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 47860e5..4c84b4d0 100644 --- a

[PATCH 0/3] zone-append support in aio and io-uring

2020-06-17 Thread Kanchan Joshi
three opcodes: IORING_OP_ZONE_APPEND/APPENDV/APPENDV_FIXED. Since io_uring does not have aio-like res2, cqe->flags are repurposed to return zone-relative offset Kanchan Joshi (1): aio: add support for zone-append Selvakumar S (2): fs,block: Introduce IOCB_ZONE_APPEND and direct-io handl

[PATCH v5 4/7] block: introduce write-hint to stream-id conversion

2019-04-25 Thread Kanchan Joshi
en removed. For merging checks, 'bi_write_hint' (of bio) is used instead. Signed-off-by: Kanchan Joshi --- block/blk-core.c | 29 - block/blk-merge.c| 4 ++-- drivers/nvme/host/core.c | 7 ++- include/linux/blkdev.h | 2 +- 4 files changed, 33 insert

[PATCH v4 5/7] nvme: register stream info with block layer

2019-04-17 Thread Kanchan Joshi
reservation at namespace level. Signed-off-by: Kanchan Joshi --- drivers/nvme/host/core.c | 23 ++- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 2c43e12..81b86fa 100644 --- a/drivers/nvme/host/core.c +++ b

[PATCH v4 6/7] fs: introduce APIs to enable passing write-hint with buffer-head

2019-04-17 Thread Kanchan Joshi
submit_bh and write_dirty_buffer do not take write-hint as parameter. This introduces variants which do, and pass write-hint to lower layer. Signed-off-by: Kanchan Joshi --- fs/buffer.c | 18 -- include/linux/buffer_head.h | 3 +++ 2 files changed, 19 insertions

[PATCH v4 4/7] block: introduce write-hint to stream-id conversion

2019-04-17 Thread Kanchan Joshi
nts beyond the exposed limit turn to 0. A new field 'streamid' has been added in request. While 'write-hint' field continues to exist. It keeps original value passed from upper layer, and used during merging checks. Signed-off-by: Kanchan Joshi --- block/blk-core.c | 20 +++

[PATCH v4 3/7] block: introduce API to register stream information with block-layer

2019-04-17 Thread Kanchan Joshi
This introduces stream limit (count of streams supported by underlying driver) in request-queue. Signed-off-by: Kanchan Joshi --- block/blk-settings.c | 12 include/linux/blkdev.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/block/blk-settings.c b/block/blk-settings.c