Re: [PATCH 2/5] dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure

2017-09-15 Thread Bart Van Assche
On Fri, 2017-09-15 at 16:06 -0400, Mike Snitzer wrote: > The problem is that multipath_clone_and_map() is now treated as common > code (thanks to both blk-mq and old .request_fn now enjoying the use of > blk_get_request) BUT: Ming please understand that this code is used by > old .request_fn too.

Re: [PATCH 1/5] block: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCE

2017-09-15 Thread Bart Van Assche
On Sat, 2017-09-16 at 00:44 +0800, Ming Lei wrote: > If .queue_rq() returns BLK_STS_RESOURCE, blk-mq will rerun > the queue in the three situations: > > 1) if BLK_MQ_S_SCHED_RESTART is set > - queue is rerun after one rq is completed, see blk_mq_sched_restart() > which is run from

Re: [PATCH 2/5] dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure

2017-09-15 Thread Bart Van Assche
M_MAPIO_REQUEUE; > } > clone->bio = clone->biotail = NULL; > clone->rq_disk = bdev->bd_disk; So you are reverting the patch below? Thank you very much. commit 1c23484c355ec360ca2f37914f8a4802c6baeead Author: Bart Van Assche <bart.vanass...@wdc.com> D

Re: [PATCH V3 07/12] scsi: sd_zbc: Use well defined macros

2017-09-15 Thread Bart Van Assche
On Fri, 2017-09-15 at 19:06 +0900, Damien Le Moal wrote: > instead of open coding, use the min() macro to calculate a report zones > reply buffer length in sd_zbc_check_zone_size() and the round_up() > macro for calculating the number of zones in sd_zbc_setup(). Reviewed-by: Bart V

Re: [PATCH V3 10/12] scsi: sd_zbc: Limit zone write locking to sequential zones

2017-09-15 Thread Bart Van Assche
On Fri, 2017-09-15 at 19:06 +0900, Damien Le Moal wrote: > + * There is no write constraints on conventional zones. So any write ^^^ Should this have been "There are no"? > - if (sdkp->zones_wlock && > - test_and_set_bit(zno, sdkp->zones_wlock)) > + if

Re: [PATCH V3 06/12] scsi: sd_zbc: Rearrange code

2017-09-15 Thread Bart Van Assche
On Fri, 2017-09-15 at 19:06 +0900, Damien Le Moal wrote: > Rearrange sd_zbc_setup() to include use_16_for_rw and use_10_for_rw > assignments and move the calculation of sdkp->zone_shift together > with the assignment of the verified zone_blocks value in > sd_zbc_check_zone_size(). Both functions

Re: [PATCH V3 03/12] block: Add zoned block device information to request queue

2017-09-15 Thread Bart Van Assche
On Fri, 2017-09-15 at 19:06 +0900, Damien Le Moal wrote: > @@ -492,6 +497,10 @@ struct request_queue { > struct blk_integrity integrity; > #endif /* CONFIG_BLK_DEV_INTEGRITY */ > > +#ifdef CONFIG_BLK_DEV_ZONED > + struct blk_zonedzoned; > +#endif > + > #ifdef CONFIG_PM

Re: [PATCH V3 02/12] block: Fix declaration of blk-mq scheduler functions

2017-09-15 Thread Bart Van Assche
On Fri, 2017-09-15 at 19:06 +0900, Damien Le Moal wrote: > The functions blk_mq_sched_free_hctx_data(), blk_mq_sched_try_merge(), > blk_mq_sched_try_insert_merge() and blk_mq_sched_request_inserted() are > all exported symbols but are declared only internally in > block/blk-mq-sched.h. Move these

Re: [PATCH V3 01/12] block: Fix declaration of blk-mq debugfs functions

2017-09-15 Thread Bart Van Assche
; structure to allow scheduler modules outside of the block directory to > define debugfs attributes. The title of this patch is "Fix declaration of ...". Should the title perhaps have been "Move declarations of ..."? Anyway: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V4 08/10] block: allow to allocate req with RQF_PREEMPT when queue is preempt frozen

2017-09-14 Thread Bart Van Assche
On Thu, 2017-09-14 at 09:15 +0800, Ming Lei wrote: > On Wed, Sep 13, 2017 at 07:07:53PM +0000, Bart Van Assche wrote: > > On Thu, 2017-09-14 at 01:48 +0800, Ming Lei wrote: > > > No, that patch only changes blk_insert_cloned_request() which is used > > > by dm-rq

Re: [PATCH V4 08/10] block: allow to allocate req with RQF_PREEMPT when queue is preempt frozen

2017-09-13 Thread Bart Van Assche
On Thu, 2017-09-14 at 01:48 +0800, Ming Lei wrote: > No, that patch only changes blk_insert_cloned_request() which is used > by dm-rq(mpath) only, nothing to do with the reported issue during > suspend and sending SCSI Domain validation. There may be other ways to fix the SCSI domain validation

Re: [PATCH V4 08/10] block: allow to allocate req with RQF_PREEMPT when queue is preempt frozen

2017-09-13 Thread Bart Van Assche
On Thu, 2017-09-14 at 00:48 +0800, Ming Lei wrote: > Could you please let me know if your concern about race between > preempt freeze and blk_cleanup_queue() is addressed in my last > reply? Shouldn't we wait until v4.13-rc1 has been released before spending more energy on this? Certain patches

Re: [PATCH 4/5] block: Make SCSI device suspend work reliably

2017-09-12 Thread Bart Van Assche
On Tue, 2017-09-12 at 10:29 +0800, Ming Lei wrote: > On Fri, Sep 08, 2017 at 04:52:25PM -0700, Bart Van Assche wrote: > > @@ -1350,6 +1368,16 @@ static struct request *get_request(struct > > request_queue *q, unsigned int op, > > lockdep_assert_held(q->queue_lock)

Re: [PATCH 0/5] Make SCSI device suspend work reliably

2017-09-11 Thread Bart Van Assche
On Sat, 2017-09-09 at 16:35 +0200, Oleksandr Natalenko wrote: > Since I was one of the reporters, please consider adding me to CC next time > as > I'm interested in resolving this issue properly and test each related > patchset. Hello Oleksandr, I will CC you when I repost this patch series.

Re: [PATCH 1/5] percpu-refcount: Introduce percpu_ref_switch_to_atomic_nowait()

2017-09-11 Thread Bart Van Assche
On Mon, 2017-09-11 at 10:20 -0700, Tejun Heo wrote: > Hmm... so if you know that you won't try to switch again while > switching is in progress, it should be fine. That can't be > guaranteed? Hello Tejun, After having had another look at the power management documentation I see now that power

Re: [PATCH 1/5] percpu-refcount: Introduce percpu_ref_switch_to_atomic_nowait()

2017-09-11 Thread Bart Van Assche
On Mon, 2017-09-11 at 09:37 -0700, t...@kernel.org wrote: > Hello, > > On Mon, Sep 11, 2017 at 04:09:12PM +0000, Bart Van Assche wrote: > > On Mon, 2017-09-11 at 06:13 -0700, Tejun Heo wrote: > > > On Fri, Sep 08, 2017 at 04:52:22PM -0700, Bart Van Assche wrote: >

Re: [PATCH 0/5] Make SCSI device suspend work reliably

2017-09-11 Thread Bart Van Assche
On Sat, 2017-09-09 at 18:39 +0800, Ming Lei wrote: > - the issue is not suspend/resume only, it is about SCSI quiesce vs. > RQF_PREEMPT. The only in-kernel user of the SCSI quiesce/resume functionality next to runtime power management I know of is the SPI transport, namely spi_dv_device(). Nobody

Re: [PATCH 1/5] percpu-refcount: Introduce percpu_ref_switch_to_atomic_nowait()

2017-09-11 Thread Bart Van Assche
On Mon, 2017-09-11 at 10:42 +0200, Johannes Thumshirn wrote: > On Fri, Sep 08, 2017 at 04:52:22PM -0700, Bart Van Assche wrote: > > +/** > > + * percpu_ref_switch_to_nowait - switch a percpu_ref to atomic mode > > This should probably read percpu_ref_switch_to_atomic_nowait,

Re: [PATCH 1/5] percpu-refcount: Introduce percpu_ref_switch_to_atomic_nowait()

2017-09-11 Thread Bart Van Assche
On Mon, 2017-09-11 at 06:13 -0700, Tejun Heo wrote: > On Fri, Sep 08, 2017 at 04:52:22PM -0700, Bart Van Assche wrote: > > The blk-mq core keeps track of the number of request queue users > > through q->q_usage_count. Make it possible to switch this counter > > to atom

Re: [PATCH V4 08/10] block: allow to allocate req with RQF_PREEMPT when queue is preempt frozen

2017-09-11 Thread Bart Van Assche
On Mon, 2017-09-11 at 19:10 +0800, Ming Lei wrote: > @@ -787,6 +787,35 @@ int blk_queue_enter(struct request_queue *q, unsigned > flags) > if (percpu_ref_tryget_live(>q_usage_counter)) > return 0; > > + /* > + * If queue is preempt

[PATCH 2/5] scsi: Change the type of the second last argument of scsi_execute()

2017-09-08 Thread Bart Van Assche
The second last argument of scsi_execute() is either 0 or RQF_PM. Change the type of that argument from req_flags_t into bool and update the callers that pass RQF_PM. This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Martin K. Pe

[PATCH 4/5] block: Make SCSI device suspend work reliably

2017-09-08 Thread Bart Van Assche
of that function is triggered by writing "quiesce" into /sys/class/scsi_device/*/device/state. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com> Cc: Johannes Thumshirn <jthumsh...@suse.de> Cc

[PATCH 3/5] block: Introduce REQ_PM and remove RQF_PM

2017-09-08 Thread Bart Van Assche
Tell the block layer at request allocation time whether or not a request will be used to change the power management state of a block device. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com> Cc:

[PATCH 1/5] percpu-refcount: Introduce percpu_ref_switch_to_atomic_nowait()

2017-09-08 Thread Bart Van Assche
The blk-mq core keeps track of the number of request queue users through q->q_usage_count. Make it possible to switch this counter to atomic mode from the context of the block layer power management code by introducing percpu_ref_switch_to_atomic_nowait(). Signed-off-by: Bart Van Ass

[PATCH 0/5] Make SCSI device suspend work reliably

2017-09-08 Thread Bart Van Assche
any race conditions between request queue cleanup and blk_get_request(). Please consider this patch series for kernel v4.15. Thanks, Bart. Bart Van Assche (5): percpu-refcount: Introduce percpu_ref_switch_to_atomic_nowait() scsi: Change the type of the second last argument of scsi_execute

[PATCH 5/5] blk-mq: Implement power management support

2017-09-08 Thread Bart Van Assche
ksa...@natalenko.name> References: "I/O hangs after resuming from suspend-to-ram" (https://marc.info/?l=linux-block=150340235201348). Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com> Cc: Johannes

Re: Archiving linux-block

2017-09-06 Thread Bart Van Assche
On Tue, 2017-09-05 at 08:33 -0600, Jens Axboe wrote: > On 09/05/2017 08:19 AM, Bart Van Assche wrote: > > Since gmane.org is no longer operational linux-block messages are no longer > > archived. I think it's useful to archive linux-block messages because it > > makes it po

Re: [PATCH] blk-mq: fix nr_requests wrong value when modify it from sysfs

2017-09-06 Thread Bart Van Assche
On Wed, 2017-09-06 at 15:34 +0800, weiping zhang wrote: > On Tue, Sep 05, 2017 at 03:42:45PM +0000, Bart Van Assche wrote: > > On Sun, 2017-09-03 at 21:46 +0800, weiping zhang wrote: > > > if blk-mq use "none" io scheduler, nr_request get a wrong value when &g

Archiving linux-block

2017-09-05 Thread Bart Van Assche
Hello, Since gmane.org is no longer operational linux-block messages are no longer archived. I think it's useful to archive linux-block messages because it makes it possible to review past discussions, especially for people who are not subscribed to the list. How about activating archival by

Re: BFQ + dm-mpath

2017-09-05 Thread Bart Van Assche
On Tue, 2017-09-05 at 09:56 +0200, Paolo Valente wrote: > Ok, my suspects seem confirmed: the path dm_mq_queue_rq -> map_request > -> setup_clone -> blk_rq_prep_clone creates a cloned request without > invoking e->type->ops.mq.prepare_request for the target elevator e. > The cloned request is

Re: [PATCH V3 7/8] block: allow to allocate req with REQF_PREEMPT when queue is preempt frozen

2017-09-04 Thread Bart Van Assche
On Tue, 2017-09-05 at 00:08 +0800, Ming Lei wrote: > On Mon, Sep 04, 2017 at 03:40:35PM +0000, Bart Van Assche wrote: > > On Mon, 2017-09-04 at 15:16 +0800, Ming Lei wrote: > > > On Mon, Sep 04, 2017 at 04:13:26AM +0000, Bart Van Assche wrote: > > > > Allowing blk_

Re: [PATCH V3 7/8] block: allow to allocate req with REQF_PREEMPT when queue is preempt frozen

2017-09-04 Thread Bart Van Assche
On Mon, 2017-09-04 at 15:16 +0800, Ming Lei wrote: > On Mon, Sep 04, 2017 at 04:13:26AM +0000, Bart Van Assche wrote: > > Allowing blk_get_request() to succeed after the DYING flag has been set is > > completely wrong because that could result in a request being queued after > &

Re: [PATCH V3 6/8] block: introduce preempt version of blk_[freeze|unfreeze]_queue

2017-09-04 Thread Bart Van Assche
On Sat, 2017-09-02 at 21:08 +0800, Ming Lei wrote: > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -565,6 +565,10 @@ struct request_queue { > > int bypass_depth; > atomic_tmq_freeze_depth; > + spinlock_t

Re: [PATCH V3 7/8] block: allow to allocate req with REQF_PREEMPT when queue is preempt frozen

2017-09-03 Thread Bart Van Assche
On Sat, 2017-09-02 at 21:12 +0800, Ming Lei wrote: > Please let us know if V3 addresses your previous concern about calling > blk_queue_enter_live() during preempt freezing. Do you understand how request queue cleanup works? The algorithm used for request queue cleanup is as follows: * Set the

Re: [PATCH V2 6/8] block: allow to allocate req with REQF_PREEMPT when queue is frozen

2017-09-01 Thread Bart Van Assche
st this patch series without trying to reach an agreement about the approach? Anyway, because of the unsafe blk_queue_enter_live() call introduced by this patch, please add the following to the description of this patch whenever you repost it: NAK-ed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V3 06/14] blk-mq-sched: don't dequeue request until all in ->dispatch are flushed

2017-09-01 Thread Bart Van Assche
hold > hctx->lock, we should avoid to add barrier there. Although it is not clear to me how anyone who has not followed this discussion is assumed to figure out all these subtleties, if the other comments get addressed: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 3/5] bfq: Check kstrtoul() return value

2017-09-01 Thread Bart Van Assche
On Sat, 2017-09-02 at 01:37 +0800, weiping zhang wrote: > 2017-09-02 1:14 GMT+08:00 Paolo Valente <paolo.vale...@linaro.org>: > > Il giorno 30 ago 2017, alle ore 20:42, Bart Van Assche > > <bart.vanass...@wdc.com> ha scritto: > > > > > > Make

Re: [PATCH 8/8] scsi: Introduce ZBC disk I/O scheduler

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 20:36 +0900, Damien Le Moal wrote: > +static struct scsi_disk *__zoned_scsi_disk(struct request_queue *q) > +{ > + struct scsi_device *sdp; > + struct scsi_disk *sdkp; > + > + if (!blk_queue_is_zoned(q)) { > + pr_err("zoned: Not a zoned block

Re: [PATCH 7/8] scsi: sd_zbc: Disable zone write locking with scsi-mq

2017-09-01 Thread Bart Van Assche
he scheduler dispatch queue. That is, at the time of > zone locking, the write command may already be out of order. > > Disable zone write locking in sd_zbc_write_lock_zone() if the disk is > used with scsi-mq. Write order guarantees can be provided by an > adapted I/O scheduler. R

Re: [PATCH 6/8] scsi: sd_zbc: Limit zone write locking to sequential zones

2017-09-01 Thread Bart Van Assche
s helper, wait for the disk capacity and number of zones to > stabilize on the second revalidation pass to allocate and initialize > the bitmaps. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 5/8] scsi: sd_zbc: Fix sd_zbc_read_zoned_characteristics()

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 20:36 +0900, Damien Le Moal wrote: > The three values starting at byte 8 of the Zoned Block Device > Characteristics VPD page B6h are 32 bits values, not 64bits. So use > get_unaligned_be32() to retrieve the values and not get_unaligned_be64() Reviewed-by: Bart V

Re: [PATCH 4/8] scsi: sd_zbc: Reorganize and cleanup

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 20:36 +0900, Damien Le Moal wrote: > Introduce sd_zbc.h for zbc related declarations (avoid cluttering sd.h). > > Fix comments style in sd_zbc.c (do not use documentation format) and > add/fix comments to enhance explanations. Also remove a useless blank > line in

Re: [PATCH 3/8] scsi: sd_zbc: Move ZBC declarations to scsi_proto.h

2017-09-01 Thread Bart Van Assche
/* 0x4 to 0xf are reserved */ > + ZBC_ZONE_TYPE_RESERVED = 0x4, > +}; Hello Damien, Since no code is using ZBC_ZONE_TYPE_RESERVED, is the comment about reserved values sufficient and can the definition of ZBC_ZONE_TYPE_RESERVED be left out? Anyway: Reviewed-by: Bart

Re: [PATCH 2/8] block: Fix declaration of blk-mq scheduler functions

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 20:36 +0900, Damien Le Moal wrote: > --- a/include/linux/blk-mq.h > +++ b/include/linux/blk-mq.h > @@ -284,6 +284,16 @@ void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set > *set, int nr_hw_queues); > void blk_mq_quiesce_queue_nowait(struct request_queue *q); > > /* >

Re: [PATCH 1/8] block: Fix declaration of blk-mq debugfs functions

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 20:36 +0900, Damien Le Moal wrote: > diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h > index 14542308d25b..a369174a9679 100644 > --- a/include/linux/blk-mq.h > +++ b/include/linux/blk-mq.h > @@ -5,6 +5,21 @@ > #include > #include > > +#ifdef

Re: blk_get_request sleeps in schedule

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 08:07 +0530, Suraj Choudhari wrote: > On my test system, blk_get_request() continuously hangs in schedule(). > > schedule+0x35/0x80 > schedule_timeout+0x237/0x2d0 > io_schedule_timeout+0xa6/0x110 > get_request+0x258/0x760 > blk_get_request+0x7f/0x100 > > I suspect the

Re: [PATCH 1/9] percpu-refcount: introduce percpu_ref_is_dead()

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 06:59 -0700, Tejun Heo wrote: > > +/** > > + * percpu_ref_is_dead - test whether a percpu refcount is killed > > + * @ref: percpu_ref to test > > + * > > + * Returns %true if @ref is dead > > + * > > + * This function is safe to call as long as @ref is between init and exit.

Re: [PATCH 8/9] block: allow to allocate req with REQF_PREEMPT when queue is frozen

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 11:55 +0800, Ming Lei wrote: > On Thu, Aug 31, 2017 at 10:50:25PM +0000, Bart Van Assche wrote: > > On Fri, 2017-09-01 at 01:27 +0800, Ming Lei wrote: > > > @@ -1413,9 +1414,17 @@ static struct request *blk_old_get_request(struct > > > request_queu

Re: [PATCH V3 06/14] blk-mq-sched: don't dequeue request until all in ->dispatch are flushed

2017-08-31 Thread Bart Van Assche
On Thu, 2017-08-31 at 12:01 +0800, Ming Lei wrote: > On Wed, Aug 30, 2017 at 05:11:00PM +0000, Bart Van Assche wrote: > > On Sun, 2017-08-27 at 00:33 +0800, Ming Lei wrote: > > [ ... ] > > Shouldn't blk_mq_sched_dispatch_requests() set BLK_MQ_S_DISPATCH_BUSY just > &

Memory leak in BFQ?

2017-08-31 Thread Bart Van Assche
Hello Paolo, If I run the following commands: # echo bfq > /sys/block/sda/queue/scheduler # echo 3 >/proc/sys/vm/drop_caches; find / -xdev >/dev/null # echo none > /sys/block/sda/queue/scheduler # echo scan > /sys/kernel/debug/kmemleak Then kmemleak reports the following: unreferenced object

Re: [PATCH V3 05/14] blk-mq-sched: improve dispatching from sw queue

2017-08-31 Thread Bart Van Assche
On Thu, 2017-08-31 at 11:43 +0800, Ming Lei wrote: > On Wed, Aug 30, 2017 at 04:34:47PM +0000, Bart Van Assche wrote: > > On Sun, 2017-08-27 at 00:33 +0800, Ming Lei wrote: > > > diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h > > > index 50c648

[PATCH 5/5] bfq: Use icq_to_bic() consistently

2017-08-30 Thread Bart Van Assche
Some code uses icq_to_bic() to convert an io_cq pointer to a bfq_io_cq pointer while other code uses a direct cast. Convert the code that uses a direct cast such that it uses icq_to_bic(). Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Paolo Valente <paolo.vale...@l

[PATCH 4/5] bfq: Suppress compiler warnings about comparisons

2017-08-30 Thread Bart Van Assche
tore, >bfq_slice_idle, 0, ^~~~~~~ Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Paolo Valente <paolo.vale...@linaro.org> --- block/bfq-iosched.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-ios

[PATCH 3/5] bfq: Check kstrtoul() return value

2017-08-30 Thread Bart Van Assche
Make sysfs writes fail for invalid numbers instead of storing uninitialized data copied from the stack. This patch removes all uninitialized_var() occurrences from the BFQ source code. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Paolo Valente <paolo.vale...@linaro.org>

[PATCH 2/5] bfq: Declare local functions static

2017-08-30 Thread Bart Van Assche
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Paolo Valente <paolo.vale...@linaro.org> --- block/bfq-cgroup.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c index 78b2e0db4fb2..ceefb9a

[PATCH 1/5] bfq: Annotate fall-through in a switch statement

2017-08-30 Thread Bart Van Assche
This patch avoids that gcc 7 issues a warning about fall-through when building with W=1. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Paolo Valente <paolo.vale...@linaro.org> --- block/bfq-iosched.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/bfq-iosch

[PATCH 0/5] Five BFQ patches for kernel v4.14

2017-08-30 Thread Bart Van Assche
Hello Jens, This series consists of five small patches. Three patches address compiler warnings, one patch is a fix for the BFQ sysfs interface and a fifth patch makes the BFQ code slightly more consistent. Please consider these patches for kernel v4.14. Thanks, Bart. Bart Van Assche (5

Re: [PATCH V3 13/14] blk-mq-sched: refactor blk_mq_sched_try_merge()

2017-08-30 Thread Bart Van Assche
'rq'? How about removing that local variable and renaming the 'candidate' argument into 'rq'? Anyway, with or without that change: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V3 06/14] blk-mq-sched: don't dequeue request until all in ->dispatch are flushed

2017-08-30 Thread Bart Van Assche
On Sun, 2017-08-27 at 00:33 +0800, Ming Lei wrote: > During dispatching, we moved all requests from hctx->dispatch to > one temporary list, then dispatch them one by one from this list. > Unfortunately duirng this period, run queue from other contexts ^^ during?

Re: [GIT PULL] nvme update for Linux 4.14, take 2

2017-08-30 Thread Bart Van Assche
On Wed, 2017-08-30 at 19:47 +0300, Sagi Grimberg wrote: > > > If we get to choose, my preference would be to restore the old behavior > > > because currently existing nvme transports keep their internal ctrl > > > representation in the tagset->driver_data as they implement > > > init/exit_request.

Re: [PATCH V3 05/14] blk-mq-sched: improve dispatching from sw queue

2017-08-30 Thread Bart Van Assche
On Sun, 2017-08-27 at 00:33 +0800, Ming Lei wrote: > diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h > index 50c6485cb04f..7b7a366a97f3 100644 > --- a/include/linux/blk-mq.h > +++ b/include/linux/blk-mq.h > @@ -30,6 +30,8 @@ struct blk_mq_hw_ctx { > > struct sbitmap

Re: [GIT PULL] nvme update for Linux 4.14, take 2

2017-08-30 Thread Bart Van Assche
On Wed, 2017-08-30 at 19:05 +0300, Sagi Grimberg wrote: > If we get to choose, my preference would be to restore the old behavior > because currently existing nvme transports keep their internal ctrl > representation in the tagset->driver_data as they implement > init/exit_request. Bouncing in

Re: [PATCH V3 03/14] blk-mq: introduce blk_mq_dispatch_rq_from_ctx()

2017-08-30 Thread Bart Van Assche
and applied on pending I/O from all hctxs. This > function is introduced for avoiding to dequeue too > many requests from sw queue when ->dispatch isn't > flushed completely. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V3 02/14] sbitmap: introduce __sbitmap_for_each_set()

2017-08-30 Thread Bart Van Assche
On Sun, 2017-08-27 at 00:33 +0800, Ming Lei wrote: > /** > * sbitmap_for_each_set() - Iterate over each set bit in a sbitmap. > + * @start: Where to start the iteration Thanks for having changed the name of this argument ... > -static inline void sbitmap_for_each_set(struct sbitmap *sb,

Re: [GIT PULL] nvme update for Linux 4.14, take 2

2017-08-30 Thread Bart Van Assche
On Wed, 2017-08-30 at 18:33 +0300, Sagi Grimberg wrote: > > > I just realized that patch: > > > -- > > > commit d352ae205d8b05f3f7558d10f474d8436581b3e2 > > > Author: Bart Van Assche <bart.vanass...@wdc.com> > > > Date: Thu Aug 17

Re: [GIT PULL] nvme update for Linux 4.14, take 2

2017-08-30 Thread Bart Van Assche
On Wed, 2017-08-30 at 18:10 +0300, Sagi Grimberg wrote: > I just realized that patch: > -- > commit d352ae205d8b05f3f7558d10f474d8436581b3e2 > Author: Bart Van Assche <bart.vanass...@wdc.com> > Date: Thu Aug 17 16:23:03 2017 -0700 > > blk-mq: Make blk_mq_r

Re: [PATCH] block: Call .initialize_rq_fn() also for filesystem requests

2017-08-29 Thread Bart Van Assche
On Mon, 2017-08-28 at 10:10 +0200, Christoph Hellwig wrote: > All that can be done by clearing or setting a flag on the first call to > ->queue_rq or ->queuecommand instead. In NVMe we use RQF_DONTPREP for > that, but for SCSI we probablt can't use that given that it has more > meaning for the

Re: [PATCH] block: Call .initialize_rq_fn() also for filesystem requests

2017-08-29 Thread Bart Van Assche
On Tue, 2017-08-29 at 19:16 +0800, Ming Lei wrote: > Hi Bart, > > Did you see perf regression on SRP with smaller jobs after applying > my patchset V3? > > I just run the test with 16 jobs(the system has 16 CPU cores) instead of 64, > looks not see perf regression on SRP about

[PATCH 1/2] skd: Remove blk_queue_bounce_limit() call

2017-08-29 Thread Bart Van Assche
Since sTec s1120 devices support 64-bit DMA it is not necessary to request data buffer bouncing. Hence remove the blk_queue_bounce_limit() call. Suggested-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst

[PATCH 2/2] skd: Let the block layer core choose .nr_requests

2017-08-29 Thread Bart Van Assche
Since blk_mq_init_queue() initializes .nr_requests to the tag set size and since that value is a good default for the skd driver, do not overwrite the value set by blk_mq_init_queue(). This change doubles the default value of .nr_requests. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.

[PATCH 0/2] skd: Two additional patches for kernel v4.14

2017-08-29 Thread Bart Van Assche
Hello Jens, Further code review of the skd driver resulted in two additional patches. Please consider these for kernel v4.14. Thanks, Bart. Bart Van Assche (2): skd: Remove blk_queue_bounce_limit() call skd: Let the block layer core choose .nr_requests drivers/block/skd_main.c | 2 -- 1

Re: [PATCH] block: Make blk_dequeue_request() static

2017-08-29 Thread Bart Van Assche
On Tue, 2017-08-29 at 11:54 +0900, Damien Le Moal wrote: > The only caller of this function is blk_start_request() in the same > file. Fix blk_start_request() description accordingly. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH] block: Call .initialize_rq_fn() also for filesystem requests

2017-08-28 Thread Bart Van Assche
On Mon, 2017-08-28 at 10:10 +0200, Christoph Hellwig wrote: > I still disagree that we should have an indirect function call like this > in the fast path. > > All that can be done by clearing or setting a flag on the first call to > ->queue_rq or ->queuecommand instead. In NVMe we use

Re: [PATCH V2 09/20] blk-mq: introduce BLK_MQ_F_SHARED_DEPTH

2017-08-25 Thread Bart Van Assche
On Thu, 2017-08-24 at 14:52 +0800, Ming Lei wrote: > On Tue, Aug 22, 2017 at 09:55:57PM +0000, Bart Van Assche wrote: > > On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > > > + /* > > > + * if there is q->queue_depth, all hw queues share >

Re: [PATCH V2 03/20] blk-mq: introduce blk_mq_dispatch_rq_from_ctx()

2017-08-25 Thread Bart Van Assche
On Thu, 2017-08-24 at 12:52 +0800, Ming Lei wrote: > On Tue, Aug 22, 2017 at 06:45:46PM +0000, Bart Van Assche wrote: > > On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > > > More importantly, for some SCSI devices, driver > > > tags are host wide, and the number i

Re: [PATCH V2 02/20] sbitmap: introduce __sbitmap_for_each_set()

2017-08-25 Thread Bart Van Assche
On Thu, 2017-08-24 at 11:57 +0800, Ming Lei wrote: > On Tue, Aug 22, 2017 at 06:28:54PM +0000, Bart Van Assche wrote: > > * Whether or not index >= sb->map_nr. I propose to start iterating from the > > start of @sb in this case. > > It has been checked at t

[PATCH 4/4] skd: Remove SKD_ID_INCR

2017-08-25 Thread Bart Van Assche
() only uses the lower bits of skd_request_context.id as hardware tag, this patch does not change the behavior of the skd driver. I'm referring to the following code: tag = req_id & SKD_ID_SLOT_AND_TABLE_MASK; Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph

[PATCH 2/4] skd: Inline skd_end_request()

2017-08-25 Thread Bart Van Assche
It is not worth to keep the debug statements in skd_end_request(). Without debug statements that function only consists of two statements. Hence inline skd_end_request(). Suggested-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christop

[PATCH 3/4] skd: Make it easier for static analyzers to analyze skd_free_disk()

2017-08-25 Thread Bart Van Assche
d-by: Dan Carpenter <dan.carpen...@oracle.com> Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Dan Carpenter <dan.carpen...@oracle.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de>

[PATCH 1/4] skd: Rename skd_softirq_done() into skd_complete_rq()

2017-08-25 Thread Bart Van Assche
The latter name follows more closely the function names used in other blk-mq drivers. Suggested-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Joh

[PATCH 0/4] Four more patches for the sTec s1120 driver (skd)

2017-08-25 Thread Bart Van Assche
with myself. Please consider these patches for kernel v4.14. Thanks, Bart. Bart Van Assche (4): skd: Rename skd_softirq_done() into skd_complete_rq() skd: Inline skd_end_request() skd: Make it easier for static analyzers to analyze skd_free_disk() skd: Remove SKD_ID_INCR drivers/block

Re: [bug report] skd: Avoid that module unloading triggers a use-after-free

2017-08-25 Thread Bart Van Assche
On Thu, 2017-08-24 at 21:36 +0300, Dan Carpenter wrote: > On Thu, Aug 24, 2017 at 03:04:12PM +0000, Bart Van Assche wrote: > > If you have a look at skd_cons_disk() you will see that skdev->queue != NULL > > implies that skdev->disk != NULL. So I think the above report is

[PATCH] block: Call .initialize_rq_fn() also for filesystem requests

2017-08-25 Thread Bart Van Assche
() calls from blk_get_request() into blk_mq_rq_ctx_init() and blk_rq_init(). See also https://www.spinics.net/lists/linux-scsi/msg108934.html. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Martin K. Petersen <martin.peter...@oracle.

Re: [PATCH v2] blk-mq-debugfs: Add names for recently added flags

2017-08-24 Thread Bart Van Assche
On Fri, 2017-08-18 at 15:52 -0700, Bart Van Assche wrote: > The symbolic constants QUEUE_FLAG_SCSI_PASSTHROUGH, QUEUE_FLAG_QUIESCED > and REQ_NOWAIT are missing from blk-mq-debugfs.c. Add these to > blk-mq-debugfs.c such that these appear as names in debugfs instead of > as numbe

BFQ + dm-mpath

2017-08-24 Thread Bart Van Assche
Hello Paolo, Has BFQ ever been tested in combination with dm-mpath? A few seconds after I had started a run of the srp-tests software with BFQ a kernel oops appeared on the console. The command I ran is: $ while true; do ~bart/software/infiniband/srp-test/run_tests -d -r 30 -e bfq; done And

Re: [PATCH 10/10] nvme: implement multipath access to nvme subsystems

2017-08-24 Thread Bart Van Assche
On Thu, 2017-08-24 at 10:59 +0200, h...@lst.de wrote: > On Wed, Aug 23, 2017 at 06:21:55PM +0000, Bart Van Assche wrote: > > Since generic_make_request_fast() returns BLK_STS_AGAIN for a dying path: > > can the same kind of soft lockups occur with the NVMe multipathing code as >

Re: [PATCH 4/5] skd: Avoid double completions in case of a timeout

2017-08-24 Thread Bart Van Assche
On Wed, 2017-08-23 at 20:08 +0200, Christoph Hellwig wrote: > Although as a follow on I would also move the debug printks > from skd_end_request to skd_softirq_done, then remove skd_end_request > and rename skd_softirq_done to skd_complete_rq to fit what other > drivers are doing a little more

Re: [bug report] skd: Avoid that module unloading triggers a use-after-free

2017-08-24 Thread Bart Van Assche
On Thu, 2017-08-24 at 14:04 +0300, Dan Carpenter wrote: > Hello Bart Van Assche, > > This is a semi-automatic email about new static checker warnings. > > The patch 7277cc67b391: "skd: Avoid that module unloading triggers a > use-after-free" from Aug 17, 2017, l

[PATCH 2/2] compat_hdio_ioctl: Fix a declaration

2017-08-23 Thread Bart Van Assche
/compat_ioctl.c:91:21: warning: dereference of noderef expression Fixes: commit d597580d3737 ("generic ...copy_..._user primitives") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Jens Axboe <ax...@kernel.dk> --- block/compat_ioctl.c | 2 +- 1 file changed, 1 insertion(+

[PATCH 1/2] : Fix copy_in_user() declaration

2017-08-23 Thread Bart Van Assche
copy_in_user() copies data from user-space address @from to user- space address @to. Hence declare both @from and @to as user-space pointers. Fixes: commit d597580d3737 ("generic ...copy_..._user primitives") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: <sta

[PATCH 0/2] Two copy_in_user() declaration fixes

2017-08-23 Thread Bart Van Assche
Hello Al, When I analyzed the block layer core with sparse I noticed that the declaration of copy_in_user() and also that of a pointer in compat_hdio_ioctl() are wrong. Please consider these two patches for kernel v4.14. Thanks, Bart. Bart Van Assche (2): : Fix copy_in_user() declaration

Re: [PATCH 10/10] nvme: implement multipath access to nvme subsystems

2017-08-23 Thread Bart Van Assche
On Wed, 2017-08-23 at 19:58 +0200, Christoph Hellwig wrote: > +static blk_qc_t nvme_make_request(struct request_queue *q, struct bio *bio) > +{ > + struct nvme_ns_head *head = q->queuedata; > + struct nvme_ns *ns; > + blk_qc_t ret = BLK_QC_T_NONE; > + int srcu_idx; > + > +

[PATCH 4/5] skd: Avoid double completions in case of a timeout

2017-08-23 Thread Bart Van Assche
witch to block layer timeout mechanism") Reported-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/block/sk

[PATCH 5/5] skd: Change default interrupt mode to MSI-X

2017-08-23 Thread Bart Van Assche
Since MSI support on some motherboards is unreliable, change the default interrupt mode from MSI to MSI-X. This patch avoids that the following message appears sporadially in the kernel logs of my test setup: do_IRQ: 3.193 No irq handler for vector Signed-off-by: Bart Van Assche <bart.van

[PATCH 3/5] skd: Inline skd_process_request()

2017-08-23 Thread Bart Van Assche
This patch does not change any functionality but makes the skd driver code more similar to that of other blk-mq kernel drivers. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn &

[PATCH 1/5] block: Warn if blk_queue_rq_timed_out() is called for a blk-mq queue

2017-08-23 Thread Bart Van Assche
The timeout handler set by blk_queue_rq_timed_out() is only used in single queue mode. Calling this function for blk-mq drivers is wrong. Hence issue a warning if this function is called by a blk-mq driver. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h.

[PATCH 0/5] skd fixes for kernel v4.14

2017-08-23 Thread Bart Van Assche
for testing. Please consider these patches for kernel v4.14. Thanks, Bart. Bart Van Assche (5): block: Warn if blk_queue_rq_timed_out() is called for a blk-mq queue skd: Report completion mismatches once skd: Inline skd_process_request() skd: Avoid double completions in case of a timeout skd

Re: [PATCH v2 1/2] fault-inject: Restore support for task-independent fault injection

2017-08-23 Thread Bart Van Assche
On Wed, 2017-08-23 at 09:10 +0900, Akinobu Mita wrote: > 2017-08-23 8:00 GMT+09:00 Bart Van Assche <bart.vanass...@wdc.com>: > > Certain faults should be injected independent of the context > > in which these occur. Commit e41d58185f14 made it impossible to > >

Re: [PATCH V2 00/20] blk-mq-sched: improve SCSI-MQ performance

2017-08-23 Thread Bart Van Assche
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > In Red Hat internal storage test wrt. blk-mq scheduler, we > found that I/O performance is much bad with mq-deadline, especially > about sequential I/O on some multi-queue SCSI devcies(lpfc, qla2xxx, > SRP...) Hello Ming and Jens, There may

Re: [v4.13-rc BUG] system lockup when running big buffered write(4M) to IB SRP via mpath

2017-08-23 Thread Bart Van Assche
On Wed, 2017-08-23 at 19:35 +0800, Ming Lei wrote: > soft lockup still can be observed easily with patch d4acf3650c7c( > block: Make blk_mq_delay_kick_requeue_list() rerun the queue at a quiet time), > but no hard lockup. Hello Ming, I never claimed that commit d4acf3650c7c was a full solution

<    8   9   10   11   12   13   14   15   16   17   >