[PATCH cosmetic] Remove trailing newline in elevator switch error message

2017-04-28 Thread Markus Trippelsdorf
Trying to switch to a non-existing elevator currently results in garbled dmesg output, e.g.: # echo "foo" > /sys/block/sda/queue/scheduler elevator: type foo not found elevator: switch to foo failed (note the unintended line break.) Fix by stripping the trailing newline. diff --git a/block/

Re: [PATCH ] block: don't call blk_mq_quiesce_queue() during switching mq sched

2017-04-28 Thread Ming Lei
On Fri, Apr 28, 2017 at 03:59:20PM +, Bart Van Assche wrote: > On Fri, 2017-04-28 at 07:42 -0600, Jens Axboe wrote: > > On 04/28/2017 01:32 AM, Ming Lei wrote: > > > We have freezed queue already, not necessary to call > > > blk_mq_quiesce_queue() any more, so remove it. > > > > Are you sure?

Re: [PATCH v2 3/6] RDMA/core: expose affinity mappings per completion vector

2017-04-28 Thread Doug Ledford
On Thu, 2017-04-06 at 13:36 +0300, Sagi Grimberg wrote: > This will allow ULPs to intelligently locate threads based > on completion vector cpu affinity mappings. In case the > driver does not expose a get_vector_affinity callout, return > NULL so the caller can maintain a fallback logic. > > Revi

Re: BUG: KASAN: use-after-free in scsi_exit_rq

2017-04-28 Thread t...@kernel.org
(cc'ing Jan) Hello, Bart. On Fri, Apr 21, 2017 at 09:49:17PM +, Bart Van Assche wrote: > On Thu, 2017-04-20 at 15:18 -0600, Scott Bauer wrote: > > [ 642.638860] BUG: KASAN: use-after-free in scsi_exit_rq+0xf3/0x120 at > > addr 8802b7fedf00 > > [ 642.639362] Read of size 1 by task rcuos

Re: small dm mpath cleanups

2017-04-28 Thread Bart Van Assche
On Fri, 2017-04-28 at 16:23 -0400, Mike Snitzer wrote: > On Thu, Apr 27 2017 at 2:33am -0400, h...@lst.de wrote: > > On Wed, Apr 26, 2017 at 06:41:27PM +, Bart Van Assche wrote: > > > On Wed, 2017-04-26 at 09:40 +0200, Christoph Hellwig wrote: > > > > this series has some prep patches for my

Re: [PATCH 0/4] blk-mq: support to use hw tag for scheduling

2017-04-28 Thread Jens Axboe
On 04/28/2017 09:15 AM, Ming Lei wrote: > Hi, > > This patchset introduces flag of BLK_MQ_F_SCHED_USE_HW_TAG and > allows to use hardware tag directly for IO scheduling if the queue's > depth is big enough. In this way, we can avoid to allocate extra tags > and request pool for IO schedule, and th

Re: small dm mpath cleanups

2017-04-28 Thread Mike Snitzer
On Thu, Apr 27 2017 at 2:33am -0400, h...@lst.de wrote: > On Wed, Apr 26, 2017 at 06:41:27PM +, Bart Van Assche wrote: > > On Wed, 2017-04-26 at 09:40 +0200, Christoph Hellwig wrote: > > > this series has some prep patches for my work to have proper, type > > > checked block errors codes. O

Re: [PATCH 3/4] blk-mq: use hw tag for scheduling if hw tag space is big enough

2017-04-28 Thread Bart Van Assche
On Fri, 2017-04-28 at 12:22 -0600, Jens Axboe wrote: > On 04/28/2017 09:15 AM, Ming Lei wrote: > > +/* > > + * If this queue has enough hardware tags and doesn't share tags with > > + * other queues, just use hw tag directly for scheduling. > > + */ > > +static inline bool blk_mq_sched_may_use_hw

[PATCH v2] x86, uaccess: introduce copy_from_iter_wt for pmem / writethrough operations

2017-04-28 Thread Dan Williams
The pmem driver has a need to transfer data with a persistent memory destination and be able to rely on the fact that the destination writes are not cached. It is sufficient for the writes to be flushed to a cpu-store-buffer (non-temporal / "movnt" in x86 terms), as we expect userspace to call fsyn

Re: [PATCH 2/4] blk-mq: introduce blk_mq_get_queue_depth()

2017-04-28 Thread Jens Axboe
On 04/28/2017 09:15 AM, Ming Lei wrote: > The hardware queue depth can be resized via blk_mq_update_nr_requests(), > so introduce this helper for retrieving queue's depth easily. > > Signed-off-by: Ming Lei > --- > block/blk-mq.c | 12 > block/blk-mq.h | 1 + > 2 files changed, 13

Re: [PATCH 3/4] blk-mq: use hw tag for scheduling if hw tag space is big enough

2017-04-28 Thread Jens Axboe
On 04/28/2017 09:15 AM, Ming Lei wrote: > +/* > + * If this queue has enough hardware tags and doesn't share tags with > + * other queues, just use hw tag directly for scheduling. > + */ > +static inline bool blk_mq_sched_may_use_hw_tag(struct request_queue *q) > +{ > + if (q->tag_set->flags

Re: [PATCH 4/4] blk-mq: dump new introduced flag of BLK_MQ_F_SCHED_USE_HW_TAG

2017-04-28 Thread Bart Van Assche
On Fri, 2017-04-28 at 23:15 +0800, Ming Lei wrote: > Signed-off-by: Ming Lei > --- > block/blk-mq-debugfs.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c > index bcd2a7d4a3a5..bc390847a60d 100644 > --- a/block/blk-mq-debugfs.c > +++ b/bl

Re: [PATCH 3/4] blk-mq: use hw tag for scheduling if hw tag space is big enough

2017-04-28 Thread Bart Van Assche
On Fri, 2017-04-28 at 23:15 +0800, Ming Lei wrote: > +static inline bool blk_mq_sched_may_use_hw_tag(struct request_queue *q) > +{ > + if (q->tag_set->flags & BLK_MQ_F_TAG_SHARED) > + return false; > + > + if (blk_mq_get_queue_depth(q) < q->nr_requests) > + return fa

[PATCH 1/6] mtip32xx: get rid of 'atomic' argument to mtip_exec_internal_command()

2017-04-28 Thread Jens Axboe
All callers can safely block. Kill the atomic/block argument, and remove the argument from all callers. Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 148 +++--- 1 file changed, 43 i

[PATCH 2/6] mtip32xx: kill atomic argument to mtip_quiesce_io()

2017-04-28 Thread Jens Axboe
All callers now pass in GFP_KERNEL, get rid of the argument. Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/block/mtip3

[PATCH 4/6] mtip32xx: convert internal command issue to block IO path

2017-04-28 Thread Jens Axboe
The driver special cases certain things for command issue, depending on whether it's an internal command or not. Make the internal commands use the regular infrastructure for issuing IO. Since this is an 8-group souped up AHCI variant, we have to deal with NCQ vs non-queueable commands. Do this fr

[PATCH 5/6] blk-mq-sched: remove hack that bypasses scheduler for reserved requests

2017-04-28 Thread Jens Axboe
We have update the troublesome driver (mtip32xx) to deal with this appropriately. So kill the hack that bypassed scheduler allocation and insertion for reserved requests. Reviewed-by: Ming Lei Signed-off-by: Jens Axboe --- block/blk-mq-sched.c | 6 +- 1 file changed, 1 insertion(+), 5 delet

[PATCH 6/6] Revert "mtip32xx: pass BLK_MQ_F_NO_SCHED"

2017-04-28 Thread Jens Axboe
This reverts commit 4981d04dd8f1ab19e2cce008da556d7f099b6e68. The driver has been converted to using the proper infrastructure for issuing internal commands. This means it's now safe to use with the scheduling infrastruture, so we can now revert the change that turned off scheduling for mtip32xx.

[PATCH v4 0/6] Fixup mtip32xx for scheduling

2017-04-28 Thread Jens Axboe
OK, I think we're getting there now. I dropped the RQF_RESERVED and the tag helper, since mtip32xx can just call blk_rq_is_passthrough() and know it's an internal request. We can do another cleanup series of mtip32xx making the internal requests use the normal blk end_io infrastructure, and use th

[PATCH 3/6] mtip32xx: abstract out "are any commands active" helper

2017-04-28 Thread Jens Axboe
This is a prep patch for backoff in ->queue_rq() for non-ncq commands. Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/

Re: [PATCH 5/6] mtip32xx: convert internal command issue to block IO path

2017-04-28 Thread Jens Axboe
On 04/28/2017 08:49 AM, Christoph Hellwig wrote: >> @@ -1088,6 +1088,13 @@ static int mtip_quiesce_io(struct mtip_port *port, >> unsigned long timeout) >> return -EFAULT; >> } >> >> +struct mtip_int_cmd { >> +int fis_len; >> +dma_addr_t buffer; >> +int buf_len; >> +u32 opts

Re: [PATCH 1/6] blk-mq: Make blk_mq_quiesce_queue() wait for all .queue_rq() calls

2017-04-28 Thread Ming Lei
On Fri, Apr 28, 2017 at 03:35:59PM +, Bart Van Assche wrote: > On Fri, 2017-04-28 at 10:00 +0800, Ming Lei wrote: > > On Thu, Apr 27, 2017 at 08:54:32AM -0700, Bart Van Assche wrote: > > > void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx) > > > { > > > - cancel_work(&hctx->run_work); > >

Re: [PATCH ] block: don't call blk_mq_quiesce_queue() during switching mq sched

2017-04-28 Thread Bart Van Assche
On Fri, 2017-04-28 at 07:42 -0600, Jens Axboe wrote: > On 04/28/2017 01:32 AM, Ming Lei wrote: > > We have freezed queue already, not necessary to call > > blk_mq_quiesce_queue() any more, so remove it. > > Are you sure? It ensures that we also aren't in the middle of > blk_mq_make_request(), we n

Re: [PATCH ] block: don't call blk_mq_quiesce_queue() during switching mq sched

2017-04-28 Thread Ming Lei
Hi Jens, On Fri, Apr 28, 2017 at 07:42:05AM -0600, Jens Axboe wrote: > On 04/28/2017 01:32 AM, Ming Lei wrote: > > We have freezed queue already, not necessary to call > > blk_mq_quiesce_queue() any more, so remove it. > > Are you sure? It ensures that we also aren't in the middle of > blk_mq_mak

Re: [PATCH 1/6] blk-mq: Make blk_mq_quiesce_queue() wait for all .queue_rq() calls

2017-04-28 Thread Bart Van Assche
On Fri, 2017-04-28 at 10:00 +0800, Ming Lei wrote: > On Thu, Apr 27, 2017 at 08:54:32AM -0700, Bart Van Assche wrote: > > void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx) > > { > > - cancel_work(&hctx->run_work); > > - cancel_delayed_work(&hctx->delay_work); > > + cancel_work_sync(&hct

Re: [PATCH] block: nbd: fix double free

2017-04-28 Thread Josef Bacik
Yeah I found and fixed it already, thanks, Josef On 4/28/17, 11:27 AM, "Ming Lei" wrote: On Fri, Apr 28, 2017 at 01:00:30PM +, Josef Bacik wrote: > We should have 2 references on the device at this point, did you see a “nbd: > possibly leaking a device” message before the kasan stuff? Tha

Re: [PATCH] block: nbd: fix double free

2017-04-28 Thread Ming Lei
On Fri, Apr 28, 2017 at 01:00:30PM +, Josef Bacik wrote: > We should have 2 references on the device at this point, did you see a “nbd: > possibly leaking a device” message before the kasan stuff? Thanks, > There isn't such message before kasan warning. Thanks, Ming

Re: [PATCH 6/7] blk-mq-sched: remove hack that bypasses scheduler for reserved requests

2017-04-28 Thread Ming Lei
On Fri, Apr 28, 2017 at 08:55:39AM -0600, Jens Axboe wrote: > We have update the troublesome driver (mtip32xx) to deal with this > appropriately. So kill the hack that bypassed scheduler allocation > and insertion for reserved requests. > > Signed-off-by: Jens Axboe > --- > block/blk-mq-sched.c

Re: [PATCH 4/7] blk-mq: add and export helper to tell if a request is reserved

2017-04-28 Thread Ming Lei
On Fri, Apr 28, 2017 at 08:55:37AM -0600, Jens Axboe wrote: > We only have an internal helper for checking a tag value. Add > an exported helper that takes a request and hardware queue, > and check against the driver tags. > > Signed-off-by: Jens Axboe > --- > block/blk-mq-tag.c | 6 ++ >

[PATCH 4/4] blk-mq: dump new introduced flag of BLK_MQ_F_SCHED_USE_HW_TAG

2017-04-28 Thread Ming Lei
Signed-off-by: Ming Lei --- block/blk-mq-debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index bcd2a7d4a3a5..bc390847a60d 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -220,6 +220,7 @@ static const char *const hct

[PATCH 1/4] blk-mq: introduce BLK_MQ_F_SCHED_USE_HW_TAG

2017-04-28 Thread Ming Lei
When blk-mq I/O scheduler is used, we need two tags for submitting one request. One is called scheduler tag for allocating request and scheduling I/O, another one is called driver tag, which is used for dispatching IO to hardware/driver. This way introduces one extra per-queue allocation for both t

[PATCH 2/4] blk-mq: introduce blk_mq_get_queue_depth()

2017-04-28 Thread Ming Lei
The hardware queue depth can be resized via blk_mq_update_nr_requests(), so introduce this helper for retrieving queue's depth easily. Signed-off-by: Ming Lei --- block/blk-mq.c | 12 block/blk-mq.h | 1 + 2 files changed, 13 insertions(+) diff --git a/block/blk-mq.c b/block/blk-m

[PATCH 3/4] blk-mq: use hw tag for scheduling if hw tag space is big enough

2017-04-28 Thread Ming Lei
When tag space of one device is big enough, we use hw tag directly for I/O scheduling. Now the decision is made if hw queue depth is not less than q->nr_requests and the tag set isn't shared. Signed-off-by: Ming Lei --- block/blk-mq-sched.c | 8 block/blk-mq-sched.h | 15 +

[PATCH 0/4] blk-mq: support to use hw tag for scheduling

2017-04-28 Thread Ming Lei
Hi, This patchset introduces flag of BLK_MQ_F_SCHED_USE_HW_TAG and allows to use hardware tag directly for IO scheduling if the queue's depth is big enough. In this way, we can avoid to allocate extra tags and request pool for IO schedule, and the schedule tag allocation/release can be saved in I/

Re: [PATCH 4/7] blk-mq: add and export helper to tell if a request is reserved

2017-04-28 Thread Bart Van Assche
On Fri, 2017-04-28 at 08:55 -0600, Jens Axboe wrote: > We only have an internal helper for checking a tag value. Add > an exported helper that takes a request and hardware queue, > and check against the driver tags. > > Signed-off-by: Jens Axboe > --- > block/blk-mq-tag.c | 6 ++ > inclu

[PATCH v3 0/7] Fixup mtip32xx for scheduling

2017-04-28 Thread Jens Axboe
Sending out a new version, since it'd be great to get this fixed up before sending out the 4.12 pull requests. Changes since v2(a): - Kill RQF_RESERVED. Export helper to help the driver see if a given request is reserved or not, and use this insead of RQF_RESERVED. -- Jens Axboe

[PATCH 4/7] blk-mq: add and export helper to tell if a request is reserved

2017-04-28 Thread Jens Axboe
We only have an internal helper for checking a tag value. Add an exported helper that takes a request and hardware queue, and check against the driver tags. Signed-off-by: Jens Axboe --- block/blk-mq-tag.c | 6 ++ include/linux/blk-mq.h | 1 + 2 files changed, 7 insertions(+) diff --git

[PATCH 6/7] blk-mq-sched: remove hack that bypasses scheduler for reserved requests

2017-04-28 Thread Jens Axboe
We have update the troublesome driver (mtip32xx) to deal with this appropriately. So kill the hack that bypassed scheduler allocation and insertion for reserved requests. Signed-off-by: Jens Axboe --- block/blk-mq-sched.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/b

[PATCH 3/7] mtip32xx: abstract out "are any commands active" helper

2017-04-28 Thread Jens Axboe
This is a prep patch for backoff in ->queue_rq() for non-ncq commands. Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/

[PATCH 1/7] mtip32xx: get rid of 'atomic' argument to mtip_exec_internal_command()

2017-04-28 Thread Jens Axboe
All callers can safely block. Kill the atomic/block argument, and remove the argument from all callers. Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 148 +++--- 1 file changed, 43 i

[PATCH 2/7] mtip32xx: kill atomic argument to mtip_quiesce_io()

2017-04-28 Thread Jens Axboe
All callers now pass in GFP_KERNEL, get rid of the argument. Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/block/mtip3

[PATCH 5/7] mtip32xx: convert internal command issue to block IO path

2017-04-28 Thread Jens Axboe
The driver special cases certain things for command issue, depending on whether it's an internal command or not. Make the internal commands use the regular infrastructure for issuing IO. Since this is an 8-group souped up AHCI variant, we have to deal with NCQ vs non-queueable commands. Do this fr

[PATCH 7/7] Revert "mtip32xx: pass BLK_MQ_F_NO_SCHED"

2017-04-28 Thread Jens Axboe
This reverts commit 4981d04dd8f1ab19e2cce008da556d7f099b6e68. The driver has been converted to using the proper infrastructure for issuing internal commands. This means it's now safe to use with the scheduling infrastruture, so we can now revert the change that turned off scheduling for mtip32xx.

Re: update ->init_request and ->exit_request prototypes

2017-04-28 Thread Christoph Hellwig
On Thu, Apr 27, 2017 at 07:44:56PM +0200, Christoph Hellwig wrote: > Hi Jens, > > this series (against for-4.12/post-merge) updates the blk-mq > ->init_request and ->exit request methods to drop a now harmful > parameter, and update one to pass a little more information. It > then cleans up the n

Re: [PATCH 6/6] Revert "mtip32xx: pass BLK_MQ_F_NO_SCHED"

2017-04-28 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [PATCH 5/6] mtip32xx: convert internal command issue to block IO path

2017-04-28 Thread Christoph Hellwig
> @@ -1088,6 +1088,13 @@ static int mtip_quiesce_io(struct mtip_port *port, > unsigned long timeout) > return -EFAULT; > } > > +struct mtip_int_cmd { > + int fis_len; > + dma_addr_t buffer; > + int buf_len; > + u32 opts; > +}; I know passing the dma_addr is probably the e

Re: [PATCH 4/6] blk-mq: don't bypass scheduler for reserved requests

2017-04-28 Thread Jens Axboe
On 04/28/2017 08:41 AM, Christoph Hellwig wrote: > On Fri, Apr 28, 2017 at 08:31:49AM -0600, Jens Axboe wrote: >> Instead of bypassing the scheduler for insertion of reserved requests, >> we ensure that the request is marked as RQF_RESERVED so they driver >> knows where it came from. >> >> Usually

Re: [PATCH 4/6] blk-mq: don't bypass scheduler for reserved requests

2017-04-28 Thread Christoph Hellwig
On Fri, Apr 28, 2017 at 08:31:49AM -0600, Jens Axboe wrote: > Instead of bypassing the scheduler for insertion of reserved requests, > we ensure that the request is marked as RQF_RESERVED so they driver > knows where it came from. > > Usually we just use the tag to know if it's reserved or not, >

Re: [PATCH 3/6] mtip32xx: abstract out "are any commands active" helper

2017-04-28 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 2/6] mtip32xx: kill atomic argument to mtip_quiesce_io()

2017-04-28 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 1/6] mtip32xx: get rid of 'atomic' argument to mtip_exec_internal_command()

2017-04-28 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

[PATCH 2/6] mtip32xx: kill atomic argument to mtip_quiesce_io()

2017-04-28 Thread Jens Axboe
All callers now pass in GFP_KERNEL, get rid of the argument. Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/

[PATCH 6/6] Revert "mtip32xx: pass BLK_MQ_F_NO_SCHED"

2017-04-28 Thread Jens Axboe
This reverts commit 4981d04dd8f1ab19e2cce008da556d7f099b6e68. The driver has been converted to using the proper infrastructure for issuing internal commands. This means it's now safe to use with the scheduling infrastruture, so we can now revert the change that turned off scheduling for mtip32xx.

[PATCH v2a 0/6]: Fixup mtip32xx for scheduling

2017-04-28 Thread Jens Axboe
Since I fat-fingered the previous posting of v2, here's a v2a that is what v2 should have been. No changes since v2, just for easier review. Sorry about that. To recap, changes since v1: - Mark internal commands as REQ_OP_DRV_IN. Doesn't really matter what the data direction is, the important b

[PATCH 1/6] mtip32xx: get rid of 'atomic' argument to mtip_exec_internal_command()

2017-04-28 Thread Jens Axboe
All callers can safely block. Kill the atomic/block argument, and remove the argument from all callers. Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 148 +++--- 1 file changed, 43 insertions(+), 105 deletions(-)

[PATCH 3/6] mtip32xx: abstract out "are any commands active" helper

2017-04-28 Thread Jens Axboe
This is a prep patch for backoff in ->queue_rq() for non-ncq commands. Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.

[PATCH 5/6] mtip32xx: convert internal command issue to block IO path

2017-04-28 Thread Jens Axboe
The driver special cases certain things for command issue, depending on whether it's an internal command or not. Make the internal commands use the regular infrastructure for issuing IO. Since this is an 8-group souped up AHCI variant, we have to deal with NCQ vs non-queueable commands. Do this fr

[PATCH 4/6] blk-mq: don't bypass scheduler for reserved requests

2017-04-28 Thread Jens Axboe
Instead of bypassing the scheduler for insertion of reserved requests, we ensure that the request is marked as RQF_RESERVED so they driver knows where it came from. Usually we just use the tag to know if it's reserved or not, but that only works when the request has a driver tag assigned. Using RQ

Re: [PATCH 1/5] blk-mq: update ->init_request and ->exit_request prototypes

2017-04-28 Thread Jeff Moyer
Christoph Hellwig writes: >> If you got rid of request_idx, then this shouldn't build. So, is there >> some other prerequisite patch I'm missing? > > Yes, both you and I are. It's "mtip32xx: use runtime tag to initialize > command header" which is in Jens' for-4.12/block tree, but not in the >

Re: [PATCH] block: hide badblocks attribute by default

2017-04-28 Thread Jens Axboe
On Thu, Apr 27 2017, Dan Williams wrote: > Commit 99e6608c9e74 "block: Add badblock management for gendisks" > allowed for drivers like pmem and software-raid to advertise a list of > bad media areas. However, it inadvertently added a 'badblocks' to all > block devices. Lets clean this up by having

Re: [PATCH 1/5] blk-mq: update ->init_request and ->exit_request prototypes

2017-04-28 Thread Christoph Hellwig
On Fri, Apr 28, 2017 at 08:20:26AM -0600, Jens Axboe wrote: > Actually, I'll leave it as-is, just base things on top of for-next for > now. Ok. I'll resend the init_request changes then, as having request_idx around in a blk-mq iosched world is actively harmful.

Re: [PATCH 1/5] blk-mq: update ->init_request and ->exit_request prototypes

2017-04-28 Thread Jens Axboe
On 04/28/2017 08:19 AM, Jens Axboe wrote: > On 04/28/2017 08:09 AM, Christoph Hellwig wrote: >> On Thu, Apr 27, 2017 at 02:20:21PM -0400, Jeff Moyer wrote: >>> Hi, Christoph, >>> >>> Christoph Hellwig writes: >>> Remove the request_idx parameter, which can't be used safely now that we su

Re: [PATCH 1/5] blk-mq: update ->init_request and ->exit_request prototypes

2017-04-28 Thread Jens Axboe
On 04/28/2017 08:09 AM, Christoph Hellwig wrote: > On Thu, Apr 27, 2017 at 02:20:21PM -0400, Jeff Moyer wrote: >> Hi, Christoph, >> >> Christoph Hellwig writes: >> >>> Remove the request_idx parameter, which can't be used safely now that we >>> support I/O schedulers with blk-mq. Except for a sup

Re: [PATCH v2 0/6] Fixup mtip32xx for scheduling

2017-04-28 Thread Jens Axboe
On 04/28/2017 08:14 AM, Christoph Hellwig wrote: > On Fri, Apr 28, 2017 at 08:13:56AM -0600, Jens Axboe wrote: >> On 04/28/2017 08:10 AM, Christoph Hellwig wrote: >>> On Fri, Apr 28, 2017 at 08:01:49AM -0600, Jens Axboe wrote: Round two of this patchset to cleanup. Changes since the first

Re: [PATCH] nbd: fix use after free on module unload

2017-04-28 Thread Jens Axboe
On 04/28/2017 07:49 AM, Josef Bacik wrote: > list_for_each_entry() isn't super safe if we're freeing the objects > while we traverse the list. Also don't bother taking the extra > reference, the module refcounting stuff will save us from having anybody > messing with the device while we're trying

Re: [PATCH v2 0/6] Fixup mtip32xx for scheduling

2017-04-28 Thread Christoph Hellwig
On Fri, Apr 28, 2017 at 08:13:56AM -0600, Jens Axboe wrote: > On 04/28/2017 08:10 AM, Christoph Hellwig wrote: > > On Fri, Apr 28, 2017 at 08:01:49AM -0600, Jens Axboe wrote: > >> Round two of this patchset to cleanup. Changes since the first > >> posting: > > > > I got two mixed series in my inbo

Re: [PATCH v2 0/6] Fixup mtip32xx for scheduling

2017-04-28 Thread Jens Axboe
On 04/28/2017 08:10 AM, Christoph Hellwig wrote: > On Fri, Apr 28, 2017 at 08:01:49AM -0600, Jens Axboe wrote: >> Round two of this patchset to cleanup. Changes since the first >> posting: > > I got two mixed series in my inbox, one with two patches and one with > 6. The two patch one doesn't see

Re: [PATCH v2 0/6] Fixup mtip32xx for scheduling

2017-04-28 Thread Christoph Hellwig
On Fri, Apr 28, 2017 at 08:01:49AM -0600, Jens Axboe wrote: > Round two of this patchset to cleanup. Changes since the first > posting: I got two mixed series in my inbox, one with two patches and one with 6. The two patch one doesn't seem to have a cover letter. > > - Mark internal commands as

Re: [PATCH 1/5] blk-mq: update ->init_request and ->exit_request prototypes

2017-04-28 Thread Christoph Hellwig
On Thu, Apr 27, 2017 at 02:20:21PM -0400, Jeff Moyer wrote: > Hi, Christoph, > > Christoph Hellwig writes: > > > Remove the request_idx parameter, which can't be used safely now that we > > support I/O schedulers with blk-mq. Except for a superflous check in > > mtip32xx it was unused anyway. >

[PATCH 6/6] Revert "mtip32xx: pass BLK_MQ_F_NO_SCHED"

2017-04-28 Thread Jens Axboe
This reverts commit 4981d04dd8f1ab19e2cce008da556d7f099b6e68. The driver has been converted to using the proper infrastructure for issuing internal commands. This means it's now safe to use with the scheduling infrastruture, so we can now revert the change that turned off scheduling for mtip32xx.

[PATCH v2 0/6] Fixup mtip32xx for scheduling

2017-04-28 Thread Jens Axboe
Round two of this patchset to cleanup. Changes since the first posting: - Mark internal commands as REQ_OP_DRV_IN. Doesn't really matter what the data direction is, the important bit is that we need to ensure the request is seen as a passthrough. - Remove redundant active = 1 setting in mtip_

[PATCH 2/2] Revert "mtip32xx: pass BLK_MQ_F_NO_SCHED"

2017-04-28 Thread Jens Axboe
This reverts commit 4981d04dd8f1ab19e2cce008da556d7f099b6e68. The driver has been converted to using the proper infrastructure for issuing internal commands. This means it's now safe to use with the scheduling infrastruture, so we can now revert the change that turned off scheduling for mtip32xx.

[PATCH 1/6] mtip32xx: get rid of 'atomic' argument to mtip_exec_internal_command()

2017-04-28 Thread Jens Axboe
All callers can safely block. Kill the atomic/block argument, and remove the argument from all callers. Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 148 +++--- 1 file changed, 43 insertions(+), 105 deletions(-)

[PATCH 5/6] mtip32xx: convert internal command issue to block IO path

2017-04-28 Thread Jens Axboe
The driver special cases certain things for command issue, depending on whether it's an internal command or not. Make the internal commands use the regular infrastructure for issuing IO. Since this is an 8-group souped up AHCI variant, we have to deal with NCQ vs non-queueable commands. Do this fr

[PATCH 2/6] mtip32xx: kill atomic argument to mtip_quiesce_io()

2017-04-28 Thread Jens Axboe
All callers now pass in GFP_KERNEL, get rid of the argument. Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/

[PATCH 3/6] mtip32xx: abstract out "are any commands active" helper

2017-04-28 Thread Jens Axboe
This is a prep patch for backoff in ->queue_rq() for non-ncq commands. Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.

[PATCH 1/2] mtip32xx: convert internal command issue to block IO path

2017-04-28 Thread Jens Axboe
The driver special cases certain things for command issue, depending on whether it's an internal command or not. Make the internal commands use the regular infrastructure for issuing IO. Since this is an 8-group souped up AHCI variant, we have to deal with NCQ vs non-queueable commands. Do this fr

[PATCH 4/6] blk-mq: don't bypass scheduler for reserved requests

2017-04-28 Thread Jens Axboe
Instead of bypassing the scheduler for insertion of reserved requests, we ensure that the request is marked as RQF_RESERVED so they driver knows where it came from. Usually we just use the tag to know if it's reserved or not, but that only works when the request has a driver tag assigned. Using RQ

[PATCH] nbd: fix use after free on module unload

2017-04-28 Thread Josef Bacik
list_for_each_entry() isn't super safe if we're freeing the objects while we traverse the list. Also don't bother taking the extra reference, the module refcounting stuff will save us from having anybody messing with the device while we're trying to unload. Reported-by: Ming Lei Signed-off-by: J

Re: [PATCH ] block: don't call blk_mq_quiesce_queue() during switching mq sched

2017-04-28 Thread Jens Axboe
On 04/28/2017 01:32 AM, Ming Lei wrote: > We have freezed queue already, not necessary to call > blk_mq_quiesce_queue() any more, so remove it. Are you sure? It ensures that we also aren't in the middle of blk_mq_make_request(), we need a stable view of the sched status throughout that. Similarly

Re: [PATCH] MAINTAINERS: bfq: Add Paolo as maintainer for the BFQ I/O scheduler

2017-04-28 Thread Jens Axboe
On 04/28/2017 04:10 AM, Ulf Hansson wrote: > Seems like this was forgotten in the bfq-series from Paolo. Let's do it now > so people don't miss out involving Paolo for any future changes or when > reporting bugs. Thanks, added. -- Jens Axboe

Re: [PATCH] block: nbd: fix double free

2017-04-28 Thread Josef Bacik
We should have 2 references on the device at this point, did you see a “nbd: possibly leaking a device” message before the kasan stuff? Thanks, Josef On 4/28/17, 12:29 AM, "Ming Lei" wrote: Looks it is a typo, just fix it, otherwise the following warning can be trigerred: [ming@VM]$sudo rmmo

Re: [PATCH] MAINTAINERS: bfq: Add Paolo as maintainer for the BFQ I/O scheduler

2017-04-28 Thread Paolo Valente
> Il giorno 28 apr 2017, alle ore 12:10, Ulf Hansson > ha scritto: > > Seems like this was forgotten in the bfq-series from Paolo. Let's do it now > so people don't miss out involving Paolo for any future changes or when > reporting bugs. > > Signed-off-by: Ulf Hansson Acked-by: Paolo Valent

[PATCH] MAINTAINERS: bfq: Add Paolo as maintainer for the BFQ I/O scheduler

2017-04-28 Thread Ulf Hansson
Seems like this was forgotten in the bfq-series from Paolo. Let's do it now so people don't miss out involving Paolo for any future changes or when reporting bugs. Signed-off-by: Ulf Hansson --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS ind

[PATCH ] block: don't call blk_mq_quiesce_queue() during switching mq sched

2017-04-28 Thread Ming Lei
We have freezed queue already, not necessary to call blk_mq_quiesce_queue() any more, so remove it. Cc: Bart Van Assche Signed-off-by: Ming Lei --- block/elevator.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/block/elevator.c b/block/elevator.c index bf11e70f008b..c7a4ee682033 100644