linux/block
Bart Van Assche 52d7f1b5c2 blk-mq: Avoid that requeueing starts stopped queues
Since blk_mq_requeue_work() starts stopped queues and since
execution of this function can be scheduled after a queue has
been stopped it is not possible to stop queues without using
an additional state variable to track whether or not the queue
has been stopped. Hence modify blk_mq_requeue_work() such that it
does not start stopped queues. My conclusion after a review of
the blk_mq_stop_hw_queues() and blk_mq_{delay_,}kick_requeue_list()
callers is as follows:
* In the dm driver starting and stopping queues should only happen
  if __dm_suspend() or __dm_resume() is called and not if the
  requeue list is processed.
* In the SCSI core queue stopping and starting should only be
  performed by the scsi_internal_device_block() and
  scsi_internal_device_unblock() functions but not by any other
  function. Although the blk_mq_stop_hw_queue() call in
  scsi_queue_rq() may help to reduce CPU load if a LLD queue is
  full, figuring out whether or not a queue should be restarted
  when requeueing a command would require to introduce additional
  locking in scsi_mq_requeue_cmd() to avoid a race with
  scsi_internal_device_block(). Avoid this complexity by removing
  the blk_mq_stop_hw_queue() call from scsi_queue_rq().
* In the NVMe core only the functions that call
  blk_mq_start_stopped_hw_queues() explicitly should start stopped
  queues.
* A blk_mq_start_stopped_hwqueues() call must be added in the
  xen-blkfront driver in its blkif_recover() function.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Roger Pau Monné <roger.pau@citrix.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: James Bottomley <jejb@linux.vnet.ibm.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
2016-11-02 12:50:19 -06:00
..
partitions
badblocks.c
bio-integrity.c block: remove bio_is_rw 2016-10-28 08:45:17 -06:00
bio.c block: add bio_iov_iter_get_pages() 2016-11-02 10:50:18 -06:00
blk-cgroup.c blkcg: Unlock blkcg_pol_mutex only once when cpd == NULL 2016-09-30 10:31:20 +02:00
blk-core.c block: better op and flags encoding 2016-10-28 08:48:16 -06:00
blk-exec.c block: split out request-only flags into a new namespace 2016-10-28 08:45:17 -06:00
blk-flush.c block,fs: use REQ_* flags directly 2016-11-01 09:43:26 -06:00
blk-integrity.c
blk-ioc.c
blk-lib.c block: better op and flags encoding 2016-10-28 08:48:16 -06:00
blk-map.c block: better op and flags encoding 2016-10-28 08:48:16 -06:00
blk-merge.c block: split out request-only flags into a new namespace 2016-10-28 08:45:17 -06:00
blk-mq-cpumap.c blk-mq: allow the driver to pass in a queue mapping 2016-09-15 08:42:03 -06:00
blk-mq-pci.c blk_mq: linux/blk-mq.h does not include all the headers it depends on 2016-09-19 08:21:51 -06:00
blk-mq-sysfs.c blk-mq: register device instead of disk 2016-09-21 07:56:16 -06:00
blk-mq-tag.c Merge branch 'for-4.9/block-irq' of git://git.kernel.dk/linux-block 2016-10-09 17:29:33 -07:00
blk-mq-tag.h Merge branch 'for-4.9/block-irq' of git://git.kernel.dk/linux-block 2016-10-09 17:29:33 -07:00
blk-mq.c blk-mq: Avoid that requeueing starts stopped queues 2016-11-02 12:50:19 -06:00
blk-mq.h blk-mq: Introduce blk_mq_hctx_stopped() 2016-11-02 12:50:19 -06:00
blk-settings.c block: update chunk_sectors in blk_stack_limits() 2016-10-18 10:02:04 -06:00
blk-softirq.c This adds a new gcc plugin named "latent_entropy". It is designed to 2016-10-15 10:03:15 -07:00
blk-sysfs.c blk-sysfs: Add 'chunk_sectors' to sysfs attributes 2016-10-18 10:02:02 -06:00
blk-tag.c block: split out request-only flags into a new namespace 2016-10-28 08:45:17 -06:00
blk-throttle.c block: replace REQ_THROTTLED with a bio flag 2016-10-28 08:45:17 -06:00
blk-timeout.c
blk-zoned.c block: zoned: fix harmless maybe-uninitialized warning 2016-10-24 20:51:22 -06:00
blk.h block: split out request-only flags into a new namespace 2016-10-28 08:45:17 -06:00
bounce.c
bsg-lib.c
bsg.c
cfq-iosched.c block: replace REQ_NOIDLE with REQ_IDLE 2016-11-01 09:43:26 -06:00
cmdline-parser.c
compat_ioctl.c
deadline-iosched.c
elevator.c block: better op and flags encoding 2016-10-28 08:48:16 -06:00
genhd.c block: fix bdi vs gendisk lifetime mismatch 2016-08-04 14:19:16 -06:00
ioctl.c blk-zoned: implement ioctls 2016-10-18 10:05:42 -06:00
ioprio.c
Kconfig block: Implement support for zoned block devices 2016-10-18 10:05:40 -06:00
Kconfig.iosched
Makefile block: Implement support for zoned block devices 2016-10-18 10:05:40 -06:00
noop-iosched.c
partition-generic.c
scsi_ioctl.c
t10-pi.c