Re: [PATCH v2 0/6] Improve I/O priority handling

2018-11-19 Thread Jens Axboe
On 11/19/18 6:52 PM, Damien Le Moal wrote: > This small series based on for-4.21/block brings improvements to I/O priority > hanlding. The main fixes are in patches 5, 6 and 7. These fix BIO and request > I/O priority initialization for both the synchronous and asynchronous pathes. Applied,

[PATCH v2 2/6] block: Remove bio->bi_ioc

2018-11-19 Thread Damien Le Moal
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 for a bio argument. Further simplify the code and make it more readable

[PATCH v2 3/6] block: Introduce get_current_ioprio()

2018-11-19 Thread Damien Le Moal
Define get_current_ioprio() as an inline helper to obtain the caller I/O priority from its task I/O context. Use this helper in blk_init_request_from_bio() to set a request ioprio. Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Damien Le Moal ---

[PATCH v2 4/6] aio: Fix fallback I/O priority value

2018-11-19 Thread Damien Le Moal
For cases when the application does not specify aio_reqprio for an aio, fallback to use get_current_ioprio() to obtain the task I/O priority last set using ioprio_set() rather than the hardcoded IOPRIO_CLASS_NONE value. Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by:

Re: [PATCH 3/7] block: Fix get_task_ioprio() default return value

2018-11-19 Thread Damien Le Moal
On Mon, 2018-11-19 at 00:16 -0800, Christoph Hellwig wrote: > On Mon, Nov 19, 2018 at 12:51:27PM +0900, Damien Le Moal wrote: > > As explained in ioprio_get() and ionice man pages, the default I/O > > priority class for processes which have not set an I/O priority > > using > > ioprio_set() is

[PATCH v2 5/6] block: prevent merging of requests with different priorities

2018-11-19 Thread Damien Le Moal
Growing in size a high priority request by merging it with a lower priority BIO or request will increase the request execution time. This is the opposite result of the desired effect of high I/O priorities, namely getting low I/O latencies. Prevent merging of requests and BIOs that have different

[PATCH v2 1/6] aio: Comment use of IOCB_FLAG_IOPRIO aio flag

2018-11-19 Thread Damien Le Moal
Comment the use of the IOCB_FLAG_IOPRIO aio flag similarly to the IOCB_FLAG_RESFD flag. Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Damien Le Moal --- include/uapi/linux/aio_abi.h | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v2 0/6] Improve I/O priority handling

2018-11-19 Thread Damien Le Moal
This small series based on for-4.21/block brings improvements to I/O priority hanlding. The main fixes are in patches 5, 6 and 7. These fix BIO and request I/O priority initialization for both the synchronous and asynchronous pathes. Changes from v1: * Removed not very useful comments in patch 5

[PATCH v2 6/6] block: Initialize BIO I/O priority early

2018-11-19 Thread Damien Le Moal
For the synchronous I/O path case (read(), write() etc system calls), a BIO I/O priority is not initialized until the execution of blk_init_request_from_bio() when the BIO is submitted and a request initialized for the BIO execution. This is due to the ki_ioprio field of the struct kiocb defined

Re: [PATCH 4/7] block: Introduce get_current_ioprio()

2018-11-19 Thread Damien Le Moal
Adam, On 2018/11/20 3:18, Adam Manzanares wrote: > On Mon, 2018-11-19 at 12:51 +0900, Damien Le Moal wrote: >> Define get_current_ioprio() as an inline helper to obtain the caller >> I/O priority from its task I/O context. Use this helper in >> blk_init_request_from_bio() to set a request ioprio.

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

2018-11-19 Thread Ming Lei
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 via sysfs. This patch fixes the issue by the following approach: 1) introduce 'struct blk_mq_ctxs' for holding .mq_kobj and managing all

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

2018-11-19 Thread Greg Kroah-Hartman
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 via sysfs. > > This patch fixes the issue by the following approach: > > 1)

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

2018-11-19 Thread Adam Manzanares
On Mon, 2018-11-19 at 12:51 +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 for a

Re: [PATCH 5/7] aio: Fix fallback I/O priority value

2018-11-19 Thread Adam Manzanares
On Mon, 2018-11-19 at 12:51 +0900, Damien Le Moal wrote: > For cases when the application does not specify aio_reqprio for an > aio, > fallback to use get_current_ioprio() to obtain the task I/O priority > last set using ioprio_set() rather than the hardcoded > IOPRIO_CLASS_NONE > value. > >

Re: [PATCH 7/7] block: Initialize BIO I/O priority early

2018-11-19 Thread Adam Manzanares
On Mon, 2018-11-19 at 12:51 +0900, Damien Le Moal wrote: > For the synchronous I/O path case (read(), write() etc system calls), > a > BIO I/O priority is not initialized until the execution of > blk_init_request_from_bio() when the BIO is submitted and a request > initialized for the BIO

Re: [PATCH 4/7] block: Introduce get_current_ioprio()

2018-11-19 Thread Adam Manzanares
On Mon, 2018-11-19 at 12:51 +0900, Damien Le Moal wrote: > Define get_current_ioprio() as an inline helper to obtain the caller > I/O priority from its task I/O context. Use this helper in > blk_init_request_from_bio() to set a request ioprio. > > Signed-off-by: Damien Le Moal > --- >

Re: [PATCH 3/7] nvme-fc: remove unused poll implementation

2018-11-19 Thread James Smart
On 11/19/2018 7:19 AM, Jens Axboe wrote: On 11/19/18 12:59 AM, Christoph Hellwig wrote: On Sat, Nov 17, 2018 at 02:43:50PM -0700, Jens Axboe wrote: This relies on the fc taget ops setting ->poll_queue, which nobody does. Otherwise it just checks if something has completed, which isn't very

Re: [PATCH 4/7] blk-mq: when polling for IO, look for any completion

2018-11-19 Thread Christoph Hellwig
> diff --git a/block/blk-mq.c b/block/blk-mq.c > index 52b1c97cd7c6..3ca00d712158 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -3266,9 +3266,7 @@ static bool blk_mq_poll_hybrid_sleep(struct > request_queue *q, >* 0: use half of prev avg >* >0: use this specific

Re: [PATCH 5/7] blk-mq: remove 'tag' parameter from mq_ops->poll()

2018-11-19 Thread Christoph Hellwig
On Sat, Nov 17, 2018 at 02:43:52PM -0700, Jens Axboe wrote: > We always pass in -1 now and none of the callers use the tag value, > remove the parameter. > > Signed-off-by: Jens Axboe Looks good, Reviewed-by: Christoph Hellwig

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

2018-11-19 Thread Christoph Hellwig
> -bool blk_poll(struct request_queue *q, blk_qc_t cookie) > +bool blk_poll(struct request_queue *q, blk_qc_t cookie, bool spin) I find the paramter name a little confusing. Maybe wait_for_request, although I don't particularly like that one either. But we really need to document the parameter

Re: [PATCH 7/7] blk-mq: ensure mq_ops ->poll() is entered at least once

2018-11-19 Thread Christoph Hellwig
On Sat, Nov 17, 2018 at 02:43:54PM -0700, Jens Axboe wrote: > Right now we immediately bail if need_resched() is true, but > we need to do at least one loop in case we have entries waiting. > So just invert the need_resched() check, putting it at the > bottom of the loop. Looks good,

Re: [PATCH 1/5] aio: use assigned completion handler

2018-11-19 Thread Christoph Hellwig
On Sat, Nov 17, 2018 at 04:53:13PM -0700, Jens Axboe wrote: > 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(). > > Signed-off-by: Jens Axboe Looks good,

Re: [PATCH 2/5] aio: fix failure to put the file pointer

2018-11-19 Thread Christoph Hellwig
On Sat, Nov 17, 2018 at 04:53:14PM -0700, Jens Axboe wrote: > If the ioprio capability check fails, we return without putting > the file pointer. > > Fixes: d9a08a9e616b ("fs: Add aio iopriority support") > Signed-off-by: Jens Axboe Looks good. Please also send it to Al so that it can go into

Re: [PATCH V10 07/19] btrfs: use bvec_last_segment to get bio's last page

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:37:10PM +0100, Christoph Hellwig wrote: > On Thu, Nov 15, 2018 at 04:52:54PM +0800, Ming Lei wrote: > > index 2955a4ea2fa8..161e14b8b180 100644 > > --- a/fs/btrfs/compression.c > > +++ b/fs/btrfs/compression.c > > @@ -400,8 +400,11 @@ blk_status_t

Re: [PATCH 4/5] aio: support for IO polling

2018-11-19 Thread Christoph Hellwig
I like this idea, but there are a couple issues here. First the flag per command really doesn't work - we need a creation time flag. Unfortunately the existing io_setup system call doesn't take flags, so we'll need to add a new one. Second we need a check that the polling mode is actually

Re: [PATCH 5/5] aio: add support for file based polled IO

2018-11-19 Thread Christoph Hellwig
On Sat, Nov 17, 2018 at 04:53:17PM -0700, Jens Axboe wrote: > Needs further work, but this should work fine on normal setups > with a file system on a pollable block device. > > Signed-off-by: Jens Axboe > --- > fs/aio.c | 2 ++ > fs/direct-io.c | 4 +++- > fs/iomap.c | 7 +-- > 3

Re: [PATCH 1/7] aio: Comment use of IOCB_FLAG_IOPRIO aio flag

2018-11-19 Thread Christoph Hellwig
On Mon, Nov 19, 2018 at 12:51:25PM +0900, Damien Le Moal wrote: > Comment the use of the IOCB_FLAG_IOPRIO aio flag similarly to the > IOCB_FLAG_RESFD flag. > > Signed-off-by: Damien Le Moal Looks good, Reviewed-by: Christoph Hellwig

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

2018-11-19 Thread Christoph Hellwig
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

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

2018-11-19 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG

Re: [PATCH 1/7] aio: Comment use of IOCB_FLAG_IOPRIO aio flag

2018-11-19 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG

Re: [PATCH V10 08/19] btrfs: move bio_pages_all() to btrfs

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 04:23:56PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:55PM +0800, Ming Lei wrote: > > BTRFS is the only user of this helper, so move this helper into > > BTRFS, and implement it via bio_for_each_segment_all(), since > > bio->bi_vcnt may not equal to number

Re: [PATCH 3/7] block: Fix get_task_ioprio() default return value

2018-11-19 Thread Christoph Hellwig
On Mon, Nov 19, 2018 at 12:51:27PM +0900, Damien Le Moal wrote: > As explained in ioprio_get() and ionice man pages, the default I/O > priority class for processes which have not set an I/O priority using > ioprio_set() is IOPRIO_CLASS_BE and not IOPRIO_CLASS_NONE. While this matches the

Re: [PATCH 4/7] block: Introduce get_current_ioprio()

2018-11-19 Thread Christoph Hellwig
On Mon, Nov 19, 2018 at 12:51:28PM +0900, Damien Le Moal wrote: > Define get_current_ioprio() as an inline helper to obtain the caller > I/O priority from its task I/O context. Use this helper in > blk_init_request_from_bio() to set a request ioprio. > > Signed-off-by: Damien Le Moal Looks

Re: [PATCH 5/7] aio: Fix fallback I/O priority value

2018-11-19 Thread Christoph Hellwig
On Mon, Nov 19, 2018 at 12:51:29PM +0900, Damien Le Moal wrote: > For cases when the application does not specify aio_reqprio for an aio, > fallback to use get_current_ioprio() to obtain the task I/O priority > last set using ioprio_set() rather than the hardcoded IOPRIO_CLASS_NONE > value. > >

Re: [PATCH V10 08/19] btrfs: move bio_pages_all() to btrfs

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:38:45PM +0100, Christoph Hellwig wrote: > On Thu, Nov 15, 2018 at 04:52:55PM +0800, Ming Lei wrote: > > BTRFS is the only user of this helper, so move this helper into > > BTRFS, and implement it via bio_for_each_segment_all(), since > > bio->bi_vcnt may not equal to

Re: [PATCH 6/7] block: prevent merging of requests with different priorities

2018-11-19 Thread Christoph Hellwig
> + /* > + * Don't allow merge of different I/O priorities. > + */ > + if (req->ioprio != next->ioprio) > + return NULL; > + /* > + * Don't allow merge of different I/O priorities. > + */ > + if (rq->ioprio != bio_prio(bio)) > + return

Re: [PATCH 7/7] block: Initialize BIO I/O priority early

2018-11-19 Thread Christoph Hellwig
On Mon, Nov 19, 2018 at 12:51:31PM +0900, Damien Le Moal wrote: > For the synchronous I/O path case (read(), write() etc system calls), a > BIO I/O priority is not initialized until the execution of > blk_init_request_from_bio() when the BIO is submitted and a request > initialized for the BIO

Re: [PATCH V10 09/19] block: introduce bio_bvecs()

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:45:41PM +0100, Christoph Hellwig wrote: > On Thu, Nov 15, 2018 at 04:52:56PM +0800, Ming Lei wrote: > > There are still cases in which we need to use bio_bvecs() for get the > > number of multi-page segment, so introduce it. > > The only user in your final tree seems to

Re: [PATCH V10 08/19] btrfs: move bio_pages_all() to btrfs

2018-11-19 Thread Christoph Hellwig
On Mon, Nov 19, 2018 at 04:19:24PM +0800, Ming Lei wrote: > On Fri, Nov 16, 2018 at 02:38:45PM +0100, Christoph Hellwig wrote: > > On Thu, Nov 15, 2018 at 04:52:55PM +0800, Ming Lei wrote: > > > BTRFS is the only user of this helper, so move this helper into > > > BTRFS, and implement it via

Re: [PATCH V10 10/19] block: loop: pass multi-page bvec to iov_iter

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 04:40:22PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:57PM +0800, Ming Lei wrote: > > iov_iter is implemented with bvec itererator, so it is safe to pass > > multipage bvec to it, and this way is much more efficient than > > passing one page in each bvec. >

Re: [PATCH 4/7] block: Introduce get_current_ioprio()

2018-11-19 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG

Re: [PATCH V10 11/19] bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages()

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 04:44:02PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:58PM +0800, Ming Lei wrote: > > bch_bio_alloc_pages() is always called on one new bio, so it is safe > > to access the bvec table directly. Given it is the only kind of this > > case, open code the bvec

Re: [PATCH 5/7] aio: Fix fallback I/O priority value

2018-11-19 Thread Johannes Thumshirn
Looks good, Reiewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG

Re: [PATCH V10 11/19] bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages()

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:46:45PM +0100, Christoph Hellwig wrote: > > - bio_for_each_segment_all(bv, bio, i) { > > + for (i = 0, bv = bio->bi_io_vec; i < bio->bi_vcnt; bv++) { > > This really needs a comment. Otherwise it looks fine to me. OK, will do it in next version. Thanks, Ming

Re: [PATCH V10 12/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 01:42:52PM +0100, David Sterba wrote: > On Thu, Nov 15, 2018 at 04:52:59PM +0800, Ming Lei wrote: > > diff --git a/block/blk-zoned.c b/block/blk-zoned.c > > index 13ba2011a306..789b09ae402a 100644 > > --- a/block/blk-zoned.c > > +++ b/block/blk-zoned.c > > @@ -123,6 +123,7

Re: [PATCHv3 1/3] blk-mq: Return true if request was completed

2018-11-19 Thread Christoph Hellwig
On Thu, Nov 15, 2018 at 10:58:18AM -0700, Keith Busch wrote: > A driver may have internal state to cleanup if we're pretending a request > didn't complete. Return 'false' if the command wasn't actually completed > due to the timeout error injection, and true otherwise. > > Signed-off-by: Keith

Re: [PATCH V10 12/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 05:22:45PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:59PM +0800, Ming Lei wrote: > > This patch introduces one extra iterator variable to > > bio_for_each_segment_all(), > > then we can allow bio_for_each_segment_all() to iterate over multi-page > >

Re: [PATCH V10 13/19] iomap & xfs: only account for new added page

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 05:46:58PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:00PM +0800, Ming Lei wrote: > > After multi-page is enabled, one new page may be merged to a segment > > even though it is a new added page. > > > > This patch deals with this issue by post-check in

Re: [PATCH V10 13/19] iomap & xfs: only account for new added page

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:49:36PM +0100, Christoph Hellwig wrote: > I'd much rather have __bio_try_merge_page only do merges in > the same page, and have a new __bio_try_merge_segment that does > multi-page merges. This will keep the accounting a lot simpler. Looks this way is clever, will do

Re: [PATCH V10 14/19] block: enable multipage bvecs

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 05:56:27PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:01PM +0800, Ming Lei wrote: > > This patch pulls the trigger for multi-page bvecs. > > > > Now any request queue which supports queue cluster will see multi-page > > bvecs. > > > > Cc: Dave Chinner >

Re: [PATCHv3 2/3] scsi: Do not rely on blk-mq for double completions

2018-11-19 Thread Christoph Hellwig
> index 5d83a162d03b..c1d5e4e36125 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -1635,8 +1635,11 @@ static blk_status_t scsi_mq_prep_fn(struct request > *req) > > static void scsi_mq_done(struct scsi_cmnd *cmd) > { > + if

Re: [PATCHv3 3/3] blk-mq: Simplify request completion state

2018-11-19 Thread Christoph Hellwig
On Thu, Nov 15, 2018 at 10:58:20AM -0700, Keith Busch wrote: > There are no more users relying on blk-mq request states to prevent > double completions, so replace the relatively expensive cmpxchg operation > with WRITE_ONCE. > > Signed-off-by: Keith Busch Looks fine, Reviewed-by: Christoph

Re: [PATCH V10 14/19] block: enable multipage bvecs

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:53:08PM +0100, Christoph Hellwig wrote: > > - > > - if (page == bv->bv_page && off == bv->bv_offset + bv->bv_len) { > > - bv->bv_len += len; > > - bio->bi_iter.bi_size += len; > > - return true; > > -

Re: [PATCH V10 15/19] block: always define BIO_MAX_PAGES as 256

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 05:59:36PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:02PM +0800, Ming Lei wrote: > > Now multi-page bvec can cover CONFIG_THP_SWAP, so we don't need to > > increase BIO_MAX_PAGES for it. > > You mentioned to it in the cover letter, but this needs more

Re: [PATCH V10 17/19] block: don't use bio->bi_vcnt to figure out segment number

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 06:11:40PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:04PM +0800, Ming Lei wrote: > > It is wrong to use bio->bi_vcnt to figure out how many segments > > there are in the bio even though CLONED flag isn't set on this bio, > > because this bio may be

Re: [PATCH V10 18/19] block: kill QUEUE_FLAG_NO_SG_MERGE

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 06:18:11PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:05PM +0800, Ming Lei wrote: > > Since bdced438acd83ad83a6c ("block: setup bi_phys_segments after > > splitting"), > > physical segment number is mainly figured out in blk_queue_split() for > > fast

Re: [PATCH V10 18/19] block: kill QUEUE_FLAG_NO_SG_MERGE

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:58:03PM +0100, Christoph Hellwig wrote: > On Thu, Nov 15, 2018 at 04:53:05PM +0800, Ming Lei wrote: > > Since bdced438acd83ad83a6c ("block: setup bi_phys_segments after > > splitting"), > > physical segment number is mainly figured out in blk_queue_split() for > > fast

Re: nvme: allow ANA support to be independent of native multipathing

2018-11-19 Thread Christoph Hellwig
On Fri, Nov 16, 2018 at 02:28:02PM -0500, Mike Snitzer wrote: > You rejected the idea of allowing fine-grained control over whether > native NVMe multipathing is enabled or not on a per-namespace basis. > All we have is the coarse-grained nvme_core.multipath=N knob. Now > you're forecasting

Re: [PATCH V2 for-4.21 1/2] blk-mq: not embed .mq_kobj and ctx->kobj into queue instance

2018-11-19 Thread Greg Kroah-Hartman
On Sat, Nov 17, 2018 at 10:26:38AM +0800, Ming Lei wrote: > On Fri, Nov 16, 2018 at 06:05:21AM -0800, Greg Kroah-Hartman wrote: > > On Fri, Nov 16, 2018 at 07:23:10PM +0800, Ming Lei wrote: > > > @@ -456,7 +456,7 @@ struct request_queue { > > > /* > > >* mq queue kobject > > >*/ > > > -

Re: [PATCH V2 for-4.21 2/2] blk-mq: alloc q->queue_ctx as normal array

2018-11-19 Thread Greg Kroah-Hartman
On Mon, Nov 19, 2018 at 10:04:27AM +0800, Ming Lei wrote: > On Sat, Nov 17, 2018 at 11:03:42AM +0100, Greg Kroah-Hartman wrote: > > On Sat, Nov 17, 2018 at 10:34:18AM +0800, Ming Lei wrote: > > > On Fri, Nov 16, 2018 at 06:06:23AM -0800, Greg Kroah-Hartman wrote: > > > > On Fri, Nov 16, 2018 at

Re: [PATCH V2 for-4.21 1/2] blk-mq: not embed .mq_kobj and ctx->kobj into queue instance

2018-11-19 Thread Ming Lei
On Mon, Nov 19, 2018 at 11:06:06AM +0100, Greg Kroah-Hartman wrote: > On Sat, Nov 17, 2018 at 10:26:38AM +0800, Ming Lei wrote: > > On Fri, Nov 16, 2018 at 06:05:21AM -0800, Greg Kroah-Hartman wrote: > > > On Fri, Nov 16, 2018 at 07:23:10PM +0800, Ming Lei wrote: > > > > @@ -456,7 +456,7 @@ struct

[PATCH V2 10/10] doc, bfq-iosched: make it consistent with the new cgroup interface

2018-11-19 Thread Paolo Valente
BFQ now shares interface files with CFQ, for the proportional-share policy. Make documentation consistent with that. Signed-off-by: Paolo Valente --- Documentation/block/bfq-iosched.txt | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git

[PATCH V2 06/10] cgroup: make all functions of all cftypes be invoked

2018-11-19 Thread Paolo Valente
From: Angelo Ruocco When two or more entities (of any kind) share a file, their respective cftypes are linked together. The allowed operations on those files are: open, release, write and show, mapped to the functions defined in the cftypes. This commit makes the cgroup core invoke, whenever

[PATCH V2 07/10] block, bfq: use standard file names for the proportional-share policy

2018-11-19 Thread Paolo Valente
Some of the files exposed in a cgroup by bfq, for the proportional share policy, have the same meaning as the files owned by cfq (before legacy blk was removed). The old implementation of the cgroup interface didn't allow different entities to create cgroup files with the same name (in the same

[PATCH V2 03/10] cgroup: link cftypes of the same subsystem with the same name

2018-11-19 Thread Paolo Valente
From: Angelo Ruocco Two entities, of any kind, are not able to create a cgroup file with the same name in the same folder: if an entity tries to create a file that has the same name as a file created by another entity, the cgroup core stops it, warns the user about the error, and then proceeds

[PATCH V2 04/10] cgroup: add owner name to cftypes

2018-11-19 Thread Paolo Valente
From: Angelo Ruocco The piece of information "who created a certain cftype" is not stored anywhere, thus a cftype is not able to know who is its owner. This commit addresses this problem by adding a new field in the cftype structure that enables the name of its owner to be explicitly set.

[PATCH V2 09/10] doc, bfq-iosched: fix a few clerical errors

2018-11-19 Thread Paolo Valente
This commit fixes a few clerical errors in Documentation/block/bfq-iosched.txt. Signed-off-by: Paolo Valente --- Documentation/block/bfq-iosched.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/block/bfq-iosched.txt

[PATCH V2 01/10] cgroup: add hook seq_show_cft with also the owning cftype as parameter

2018-11-19 Thread Paolo Valente
The current implementation of the seq_show hook in the cftype struct has only, as parameters, the seq_file to write to and the arguments passed by the command line. Thus, the only way to retrieve the cftype that owns an instance of such hook function is by using the accessor in the seq_file

[PATCH V2 08/10] block, throttle: allow sharing cgroup statistic files

2018-11-19 Thread Paolo Valente
From: Angelo Ruocco Some of the cgroup files defined in the throttle policy have the same meaning as those defined in the proportional share policy. This commit uses the new file sharing interface in cgroup to share these files. Signed-off-by: Angelo Ruocco Signed-off-by: Paolo Valente ---

[PATCH V2 02/10] block, cgroup: pass cftype to functions that need to use it

2018-11-19 Thread Paolo Valente
Some seq_show functions need to access the cftype they belong to, for retrieving the data to show. These functions get their cftype by using the seq_cft accessor for the seq_file. This solution is no longer viable in case a seq_file is shared among more than one cftype, because the accessor always

[PATCH V2 05/10] block, bfq: align min and default weights with the old cfq default

2018-11-19 Thread Paolo Valente
From: Angelo Ruocco bfq exposes a cgroup attribute, weight, with the same meaning as that exposed by cfq. This commit changes bfq default and min weights to match the ones set by cfq (before legacy blk was removed). Signed-off-by: Angelo Ruocco Signed-off-by: Paolo Valente ---

Re: [PATCH V2 for-4.21 2/2] blk-mq: alloc q->queue_ctx as normal array

2018-11-19 Thread Ming Lei
On Mon, Nov 19, 2018 at 11:17:49AM +0100, Greg Kroah-Hartman wrote: > On Mon, Nov 19, 2018 at 10:04:27AM +0800, Ming Lei wrote: > > On Sat, Nov 17, 2018 at 11:03:42AM +0100, Greg Kroah-Hartman wrote: > > > On Sat, Nov 17, 2018 at 10:34:18AM +0800, Ming Lei wrote: > > > > On Fri, Nov 16, 2018 at

RE: [PATCH 5/8] bsg: refactor bsg_ioctl

2018-11-19 Thread Avri Altman
> On Sun, Nov 11, 2018 at 02:32:08PM +0100, Christoph Hellwig wrote: > > Move all actual functionality into helpers, just leaving the dispatch > > in this function. > > > > Signed-off-by: Christoph Hellwig > > --- > > block/bsg.c | 158 >

RE: [PATCH 6/8] bsg-lib: handle bidi requests without block layer help

2018-11-19 Thread Avri Altman
> -Original Message- > From: linux-scsi-ow...@vger.kernel.org > On Behalf Of Christoph Hellwig > Sent: Sunday, November 11, 2018 3:32 PM > To: ax...@kernel.dk; martin.peter...@oracle.com; o...@electrozaur.com > Cc: Johannes Thumshirn ; Benjamin Block > ; linux-s...@vger.kernel.org;

Re: [PATCH 4/5] aio: support for IO polling

2018-11-19 Thread Christoph Hellwig
I just saw the patch that avoids the irq disabling show up in your tree this morning. I think we can do even better by using slightly lazy lists that are not updated from ->ki_complete context. Please take a look at the patch below - this replaces patch 3 from my previous mail, that is it is

[RFC PATCH v2] block: add io timeout to sysfs

2018-11-19 Thread Weiping Zhang
Give a interface to adjust io timeout by device. Signed-off-by: Weiping Zhang --- Changes since v1: * make sure timeout > 0 block/blk-sysfs.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 80eef48fddc8..90a927514d30

Re: nvme: allow ANA support to be independent of native multipathing

2018-11-19 Thread Mike Snitzer
On Mon, Nov 19 2018 at 4:39am -0500, Christoph Hellwig wrote: > On Fri, Nov 16, 2018 at 02:28:02PM -0500, Mike Snitzer wrote: > > You rejected the idea of allowing fine-grained control over whether > > native NVMe multipathing is enabled or not on a per-namespace basis. > > All we have is the

Re: [PATCHv3 2/3] scsi: Do not rely on blk-mq for double completions

2018-11-19 Thread Jens Axboe
On 11/19/18 1:58 AM, Christoph Hellwig wrote: >> index 5d83a162d03b..c1d5e4e36125 100644 >> --- a/drivers/scsi/scsi_lib.c >> +++ b/drivers/scsi/scsi_lib.c >> @@ -1635,8 +1635,11 @@ static blk_status_t scsi_mq_prep_fn(struct request >> *req) >> >> static void scsi_mq_done(struct scsi_cmnd *cmd)

Re: [PATCH 3/7] nvme-fc: remove unused poll implementation

2018-11-19 Thread Jens Axboe
On 11/19/18 12:59 AM, Christoph Hellwig wrote: > On Sat, Nov 17, 2018 at 02:43:50PM -0700, Jens Axboe wrote: >> This relies on the fc taget ops setting ->poll_queue, which >> nobody does. Otherwise it just checks if something has >> completed, which isn't very useful. > > Please also remove the

Re: [PATCH 4/7] blk-mq: when polling for IO, look for any completion

2018-11-19 Thread Jens Axboe
On 11/19/18 1:02 AM, Christoph Hellwig wrote: >> diff --git a/block/blk-mq.c b/block/blk-mq.c >> index 52b1c97cd7c6..3ca00d712158 100644 >> --- a/block/blk-mq.c >> +++ b/block/blk-mq.c >> @@ -3266,9 +3266,7 @@ static bool blk_mq_poll_hybrid_sleep(struct >> request_queue *q, >> * 0: use

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

2018-11-19 Thread Jens Axboe
On 11/19/18 1:05 AM, Christoph Hellwig wrote: >> -bool blk_poll(struct request_queue *q, blk_qc_t cookie) >> +bool blk_poll(struct request_queue *q, blk_qc_t cookie, bool spin) > > I find the paramter name a little confusing. Maybe wait_for_request, > although I don't particularly like that one

Re: [PATCHv3 2/3] scsi: Do not rely on blk-mq for double completions

2018-11-19 Thread Keith Busch
On Mon, Nov 19, 2018 at 12:58:15AM -0800, Christoph Hellwig wrote: > > index 5d83a162d03b..c1d5e4e36125 100644 > > --- a/drivers/scsi/scsi_lib.c > > +++ b/drivers/scsi/scsi_lib.c > > @@ -1635,8 +1635,11 @@ static blk_status_t scsi_mq_prep_fn(struct request > > *req) > > > > static void

Re: [PATCH 2/5] aio: fix failure to put the file pointer

2018-11-19 Thread Jens Axboe
On 11/19/18 1:07 AM, Christoph Hellwig wrote: > On Sat, Nov 17, 2018 at 04:53:14PM -0700, Jens Axboe wrote: >> If the ioprio capability check fails, we return without putting >> the file pointer. >> >> Fixes: d9a08a9e616b ("fs: Add aio iopriority support") >> Signed-off-by: Jens Axboe > > Looks

Re: [PATCH 4/5] aio: support for IO polling

2018-11-19 Thread Jens Axboe
On 11/19/18 6:32 AM, Christoph Hellwig wrote: > > I just saw the patch that avoids the irq disabling show up in your > tree this morning. I think we can do even better by using slightly > lazy lists that are not updated from ->ki_complete context. I totally agree, it's just a first step. One