Re: [PATCH 2/7] block: Remove bio->bi_ioc

2018-11-20 Thread Damien Le Moal
On 2018/11/21 11:49, Jens Axboe wrote: > On 11/20/18 7:45 PM, Damien Le Moal wrote: >> On 2018/11/21 11:11, Jens Axboe wrote: >>> On 11/20/18 4:58 PM, Damien Le Moal wrote: On 2018/11/21 2:31, Jens Axboe wrote: > I think the below should fix it, we haven't necessarily setup an > ioc

Re: [PATCH 2/7] block: Remove bio->bi_ioc

2018-11-20 Thread Jens Axboe
On 11/20/18 7:45 PM, Damien Le Moal wrote: > On 2018/11/21 11:11, Jens Axboe wrote: >> On 11/20/18 4:58 PM, Damien Le Moal wrote: >>> On 2018/11/21 2:31, Jens Axboe wrote: I think the below should fix it, we haven't necessarily setup an ioc if we're just doing as passthrough request.

Re: [PATCH 2/7] block: Remove bio->bi_ioc

2018-11-20 Thread Damien Le Moal
On 2018/11/21 11:11, Jens Axboe wrote: > On 11/20/18 4:58 PM, Damien Le Moal wrote: >> On 2018/11/21 2:31, Jens Axboe wrote: >>> I think the below should fix it, we haven't necessarily setup an >>> ioc if we're just doing as passthrough request. >>> >>> >>> diff --git a/block/blk-mq-sched.c

Re: [PATCH] block/025: test discard sector alignement and sector size overflow

2018-11-20 Thread Ming Lei
On Thu, Nov 15, 2018 at 12:01 PM Ming Lei wrote: > > This test covers the following two issues: > > 1) discard sector need to be aligned with logical block size > > 2) make sure 'sector_t' instead of 'unsigned int' is used when comparing > with discard sector size > > Signed-off-by: Ming Lei >

Re: [PATCH 2/7] block: Remove bio->bi_ioc

2018-11-20 Thread Damien Le Moal
On 2018/11/21 11:11, Jens Axboe wrote: > On 11/20/18 4:58 PM, Damien Le Moal wrote: >> On 2018/11/21 2:31, Jens Axboe wrote: >>> I think the below should fix it, we haven't necessarily setup an >>> ioc if we're just doing as passthrough request. >>> >>> >>> diff --git a/block/blk-mq-sched.c

Re: [PATCH 2/7] block: Remove bio->bi_ioc

2018-11-20 Thread Jens Axboe
On 11/20/18 4:58 PM, Damien Le Moal wrote: > On 2018/11/21 2:31, Jens Axboe wrote: >> I think the below should fix it, we haven't necessarily setup an >> ioc if we're just doing as passthrough request. >> >> >> diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c >> index

Re: [PATCH 2/7] block: Remove bio->bi_ioc

2018-11-20 Thread Damien Le Moal
On 2018/11/21 10:24, Ming Lei wrote: > On Tue, Nov 20, 2018 at 11:58:09PM +, Damien Le Moal wrote: >> On 2018/11/21 2:31, Jens Axboe wrote: >>> I think the below should fix it, we haven't necessarily setup an >>> ioc if we're just doing as passthrough request. >>> >>> >>> diff --git

Re: [PATCH 2/7] block: Remove bio->bi_ioc

2018-11-20 Thread Ming Lei
On Tue, Nov 20, 2018 at 10:31:19AM -0700, Jens Axboe wrote: > On 11/20/18 10:21 AM, Ming Lei wrote: > > On Mon, Nov 19, 2018 at 12:51:26PM +0900, Damien Le Moal wrote: > >> bio->bi_ioc is never set so always NULL. Remove references to it in > >> bio_disassociate_task() and in rq_ioc() and delete

Re: [PATCH 2/7] block: Remove bio->bi_ioc

2018-11-20 Thread Damien Le Moal
On 2018/11/21 2:31, Jens Axboe wrote: > I think the below should fix it, we haven't necessarily setup an > ioc if we're just doing as passthrough request. > > > diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c > index 13b8dc332541..f096d8989773 100644 > --- a/block/blk-mq-sched.c > +++

Re: [PATCH 4.21 V3] blk-mq: not embed .mq_kobj and ctx->kobj into queue instance

2018-11-20 Thread Jens Axboe
On 11/20/18 9:45 AM, Guenter Roeck wrote: > On Tue, Nov 20, 2018 at 08:51:50AM +0100, Greg Kroah-Hartman wrote: >> On Tue, Nov 20, 2018 at 09:44:35AM +0800, Ming Lei wrote: >>> Even though .mq_kobj, ctx->kobj and q->kobj share same lifetime >>> from block layer's view, actually they don't because

Re: [PATCH 2/7] block: Remove bio->bi_ioc

2018-11-20 Thread Jens Axboe
On 11/20/18 10:21 AM, Ming Lei wrote: > On Mon, Nov 19, 2018 at 12:51:26PM +0900, Damien Le Moal wrote: >> bio->bi_ioc is never set so always NULL. Remove references to it in >> bio_disassociate_task() and in rq_ioc() and delete this field from >> struct bio. With this change, rq_ioc() always

Re: [PATCH 2/7] block: Remove bio->bi_ioc

2018-11-20 Thread Ming Lei
On Mon, Nov 19, 2018 at 12:51:26PM +0900, Damien Le Moal wrote: > bio->bi_ioc is never set so always NULL. Remove references to it in > bio_disassociate_task() and in rq_ioc() and delete this field from > struct bio. With this change, rq_ioc() always returns > current->io_context without the need

[PATCH 4/8] aio: use assigned completion handler

2018-11-20 Thread Jens Axboe
We know this is a read/write request, but in preparation for having different kinds of those, ensure that we call the assigned handler instead of assuming it's aio_complete_rq(). Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- fs/aio.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 7/8] aio: separate out ring reservation from req allocation

2018-11-20 Thread Jens Axboe
This is in preparation for certain types of IO not needing a ring reserveration. Signed-off-by: Jens Axboe --- fs/aio.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 8453bb849c32..8bbb0b77d9c4 100644 --- a/fs/aio.c

[PATCH 8/8] aio: support for IO polling

2018-11-20 Thread Jens Axboe
Add polled variants of PREAD/PREADV and PWRITE/PWRITEV. These act like their non-polled counterparts, except we expect to poll for completion of them. The polling happens at io_getevent() time, and works just like non-polled IO. To setup an io_context for polled IO, the application must call

[PATCH 1/8] fs: add file_operations ->iopoll() handler

2018-11-20 Thread Jens Axboe
In preparation for adding async aio iopolling. Signed-off-by: Jens Axboe --- include/linux/fs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index a1ab233e6469..9109c287437a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1781,6

[PATCH 6/8] aio: add io_setup2() system call

2018-11-20 Thread Jens Axboe
This is just like io_setup(), except we get to pass in flags for what kind of behavior we want. Signed-off-by: Jens Axboe --- arch/x86/entry/syscalls/syscall_64.tbl | 1 + fs/aio.c | 67 +- include/linux/syscalls.h | 2 +

[PATCH 3/8] iomap/xfs: wire up file_operations ->iopoll()

2018-11-20 Thread Jens Axboe
Add an iomap implementation of fops->iopoll() and wire it up for XFS. Signed-off-by: Jens Axboe --- fs/iomap.c| 50 +-- fs/xfs/xfs_file.c | 1 + include/linux/iomap.h | 1 + 3 files changed, 36 insertions(+), 16 deletions(-) diff --git

[PATCHSET v2] Support for polled aio

2018-11-20 Thread Jens Axboe
For the grand introduction to this feature, see my original posting here: https://lore.kernel.org/linux-block/20181117235317.7366-1-ax...@kernel.dk/ Since last time, a number of significant changes has been made: - Addition of the io_setup2() system call. I didn't like tracking the fact that

[PATCH 2/8] block: wire up block device ->iopoll()

2018-11-20 Thread Jens Axboe
Signed-off-by: Jens Axboe --- fs/block_dev.c | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index d233a59ea364..711cd5a3469e 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -273,6 +273,7 @@ struct blkdev_dio {

Re: [PATCH 4.21 V3] blk-mq: not embed .mq_kobj and ctx->kobj into queue instance

2018-11-20 Thread Guenter Roeck
On Tue, Nov 20, 2018 at 08:51:50AM +0100, Greg Kroah-Hartman wrote: > On Tue, Nov 20, 2018 at 09:44:35AM +0800, Ming Lei wrote: > > Even though .mq_kobj, ctx->kobj and q->kobj share same lifetime > > from block layer's view, actually they don't because userspace may > > grab one kobject anytime

[GIT PULL] nvme fix for 4.20

2018-11-20 Thread Christoph Hellwig
The following changes since commit 8dc765d438f1e42b3e8227b3b09fad7d73f4ec9a: SCSI: fix queue cleanup race before queue initialization is done (2018-11-14 08:19:10 -0700) are available in the Git repository at: git://git.infradead.org/nvme.git nvme-4.20 for you to fetch changes up to

Re: [PATCH 6/7] block: make blk_poll() take a parameter on whether to spin or not

2018-11-20 Thread Sagi Grimberg
This opportunistic poll is pretty bogus now as we never set the HIPRI flag and it should probably be removed in a prep patch. We should then later try to use a scheme similar to your aio polling for the nvme target as well. I'll kill it in a pre-patch. Agreed..