linux/block
Tejun Heo 0a30288da1 blk-mq, percpu_ref: implement a kludge for SCSI blk-mq stall during probe
blk-mq uses percpu_ref for its usage counter which tracks the number
of in-flight commands and used to synchronously drain the queue on
freeze.  percpu_ref shutdown takes measureable wallclock time as it
involves a sched RCU grace period.  This means that draining a blk-mq
takes measureable wallclock time.  One would think that this shouldn't
matter as queue shutdown should be a rare event which takes place
asynchronously w.r.t. userland.

Unfortunately, SCSI probing involves synchronously setting up and then
tearing down a lot of request_queues back-to-back for non-existent
LUNs.  This means that SCSI probing may take more than ten seconds
when scsi-mq is used.

This will be properly fixed by implementing a mechanism to keep
q->mq_usage_counter in atomic mode till genhd registration; however,
that involves rather big updates to percpu_ref which is difficult to
apply late in the devel cycle (v3.17-rc6 at the moment).  As a
stop-gap measure till the proper fix can be implemented in the next
cycle, this patch introduces __percpu_ref_kill_expedited() and makes
blk_mq_freeze_queue() use it.  This is heavy-handed but should work
for testing the experimental SCSI blk-mq implementation.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Christoph Hellwig <hch@infradead.org>
Link: http://lkml.kernel.org/g/20140919113815.GA10791@lst.de
Fixes: add703fda9 ("blk-mq: use percpu_ref for mq usage count")
Cc: Kent Overstreet <kmo@daterainc.com>
Cc: Jens Axboe <axboe@kernel.dk>
Tested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
2014-09-24 08:29:36 -06:00
..
partitions partitions: aix.c: off by one bug 2014-08-05 13:13:24 -06:00
bio-integrity.c block: Fix BUG_ON when pi errors occur 2014-08-21 20:37:47 -05:00
bio.c block: use kmalloc alignment for bio slab 2014-08-01 12:30:34 -04:00
blk-cgroup.c Merge branch 'for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup 2014-08-04 10:11:28 -07:00
blk-cgroup.h Revert "block: add __init to blkcg_policy_register" 2014-06-22 16:34:11 -06:00
blk-core.c scsi-mq: fix requests that use a separate CDB buffer 2014-08-22 15:04:31 -05:00
blk-exec.c blk-mq: avoid infinite recursion with the FUA flag 2014-09-22 11:55:19 -06:00
blk-flush.c
blk-integrity.c
blk-ioc.c
blk-iopoll.c
blk-lib.c
blk-map.c
blk-merge.c blk-merge: fix blk_recount_segments 2014-09-02 10:25:12 -06:00
blk-mq-cpu.c
blk-mq-cpumap.c
blk-mq-sysfs.c
blk-mq-tag.c blk-mq: bitmap tag: fix races in bt_get() function 2014-06-17 22:13:08 -07:00
blk-mq-tag.h blk-mq: bitmap tag: fix races on shared ::wake_index fields 2014-06-17 22:12:35 -07:00
blk-mq.c blk-mq, percpu_ref: implement a kludge for SCSI blk-mq stall during probe 2014-09-24 08:29:36 -06:00
blk-mq.h blk-mq: decouble blk-mq freezing from generic bypassing 2014-07-01 10:31:13 -06:00
blk-settings.c
blk-softirq.c
blk-sysfs.c Block: fix unbalanced bypass-disable in blk_register_queue 2014-09-09 10:44:24 -06:00
blk-tag.c block: don't assume last put of shared tags is for the host 2014-07-08 12:25:28 +02:00
blk-throttle.c cgroup: remove sane_behavior support on non-default hierarchies 2014-07-09 10:08:08 -04:00
blk-timeout.c
blk.h
bounce.c
bsg-lib.c
bsg.c
cfq-iosched.c cfq-iosched: Add comments on update timing of weight 2014-08-28 08:16:29 -06:00
cmdline-parser.c
compat_ioctl.c Merge branch 'for-3.17/core' of git://git.kernel.dk/linux-block 2014-08-14 09:07:02 -06:00
deadline-iosched.c
elevator.c Revert "block: add __init to elv_register" 2014-06-22 16:34:11 -06:00
genhd.c genhd: fix leftover might_sleep() in blk_free_devt() 2014-09-22 14:45:45 -06:00
ioctl.c block: fix BLKSECTGET ioctl when max_sectors is greater than USHRT_MAX 2014-07-01 10:43:07 -06:00
ioprio.c
Kconfig
Kconfig.iosched
Makefile
noop-iosched.c
partition-generic.c block: Fix dev_t minor allocation lifetime 2014-09-03 15:01:02 -06:00
scsi_ioctl.c block: fix error handling in sg_io 2014-08-26 08:20:01 -06:00