linux-stable/block
Ming Lei e6fc464987 blk-mq: avoid starving tag allocation after allocating process migrates
When the allocation process is scheduled back and the mapped hw queue is
changed, fake one extra wake up on previous queue for compensating wake
up miss, so other allocations on the previous queue won't be starved.

This patch fixes one request allocation hang issue, which can be
triggered easily in case of very low nr_request.

The race is as follows:

1) 2 hw queues, nr_requests are 2, and wake_batch is one

2) there are 3 waiters on hw queue 0

3) two in-flight requests in hw queue 0 are completed, and only two
   waiters of 3 are waken up because of wake_batch, but both the two
   waiters can be scheduled to another CPU and cause to switch to hw
   queue 1

4) then the 3rd waiter will wait for ever, since no in-flight request
   is in hw queue 0 any more.

5) this patch fixes it by the fake wakeup when waiter is scheduled to
   another hw queue

Cc: <stable@vger.kernel.org>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>

Modified commit message to make it clearer, and make it apply on
top of the 4.18 branch.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-05-24 11:00:39 -06:00
..
partitions partitions/msdos: Unable to mount UFS 44bsd partitions 2018-01-10 09:12:16 -07:00
badblocks.c
bfq-cgroup.c block: use ktime_get_ns() instead of sched_clock() for cfq and bfq 2018-05-09 08:33:06 -06:00
bfq-iosched.c bfq-iosched: update shallow depth to smallest one used 2018-05-10 11:27:41 -06:00
bfq-iosched.h bfq-iosched: remove unused variable 2018-05-10 11:27:31 -06:00
bfq-wf2q.c block, bfq: limit sectors served with interactive weight raising 2018-01-18 08:21:37 -07:00
bio-integrity.c block: Convert bio_set to mempool_init() 2018-05-14 13:16:03 -06:00
bio.c block: Export bio check/set pages_dirty 2018-05-14 13:16:15 -06:00
blk-cgroup.c blkcg: init root blkcg_gq under lock 2018-04-19 08:51:59 -06:00
blk-core.c block: Add warning for bi_next not NULL in bio_endio() 2018-05-14 13:16:13 -06:00
blk-exec.c blk-mq-sched: remove unused 'can_block' arg from blk_mq_sched_insert_request 2018-01-17 09:49:21 -07:00
blk-flush.c
blk-integrity.c
blk-ioc.c
blk-lib.c block: break discard submissions into the user defined size 2018-05-08 15:10:44 -06:00
blk-map.c Merge branch 'for-4.16/block' of git://git.kernel.dk/linux-block 2018-01-29 11:51:49 -08:00
blk-merge.c block: consolidate struct request timestamp fields 2018-05-09 08:33:09 -06:00
blk-mq-cpumap.c blk-mq: don't keep offline CPUs mapped to hctx 0 2018-04-10 08:38:46 -06:00
blk-mq-debugfs.c blk-mq: remove blk_mq_delay_queue() 2018-04-10 08:38:46 -06:00
blk-mq-debugfs.h
blk-mq-pci.c blk-mq: Allow PCI vector offset for mapping queues 2018-03-27 21:25:36 -06:00
blk-mq-rdma.c
blk-mq-sched.c blk-mq-sched: Enable merging discard bio into request 2018-02-01 14:45:11 -07:00
blk-mq-sched.h blk-mq-sched: remove unused 'can_block' arg from blk_mq_sched_insert_request 2018-01-17 09:49:21 -07:00
blk-mq-sysfs.c block: properly protect the 'queue' kobj in blk_unregister_queue 2018-01-15 08:41:38 -07:00
blk-mq-tag.c blk-mq: avoid starving tag allocation after allocating process migrates 2018-05-24 11:00:39 -06:00
blk-mq-tag.h
blk-mq-virtio.c
blk-mq.c blk-mq: remove wrong 'unlikely' check 2018-05-22 08:38:04 -06:00
blk-mq.h blk-mq: fix sysfs inflight counter 2018-04-26 09:02:01 -06:00
blk-settings.c block: Introduce blk_queue_flag_{set,clear,test_and_{set,clear}}() 2018-03-08 14:13:48 -07:00
blk-softirq.c
blk-stat.c block: consolidate struct request timestamp fields 2018-05-09 08:33:09 -06:00
blk-stat.h block: consolidate struct request timestamp fields 2018-05-09 08:33:09 -06:00
blk-sysfs.c block: Add sysfs entry for fua support 2018-05-14 13:16:17 -06:00
blk-tag.c
blk-throttle.c block: get rid of struct blk_issue_stat 2018-05-09 08:33:05 -06:00
blk-timeout.c blk-mq: Directly schedule q->timeout_work when aborting a request 2018-04-02 16:36:13 -06:00
blk-wbt.c block: get rid of struct blk_issue_stat 2018-05-09 08:33:05 -06:00
blk-wbt.h block: get rid of struct blk_issue_stat 2018-05-09 08:33:05 -06:00
blk-zoned.c blkdev_report_zones_ioctl(): Use vmalloc() to allocate large buffers 2018-05-22 11:58:07 -06:00
blk.h block: consolidate struct request timestamp fields 2018-05-09 08:33:09 -06:00
bounce.c block: don't disable interrupts during kmap_atomic() 2018-05-07 15:26:36 -06:00
bsg-lib.c bsg: split handling of SCSI CDBs vs transport requeues 2018-03-13 11:40:24 -06:00
bsg.c block: sanitize blk_get_request calling conventions 2018-05-14 08:55:12 -06:00
cfq-iosched.c block: consolidate struct request timestamp fields 2018-05-09 08:33:09 -06:00
cmdline-parser.c
compat_ioctl.c
deadline-iosched.c
elevator.c block: Document scheduler modification locking requirements 2018-01-18 12:54:42 -07:00
genhd.c blk-mq: fix sysfs inflight counter 2018-04-26 09:02:01 -06:00
ioctl.c block: pass inclusive 'lend' parameter to truncate_inode_pages_range 2018-02-23 15:20:19 -07:00
ioprio.c
Kconfig
Kconfig.iosched
kyber-iosched.c kyber-iosched: update shallow depth when setting up hardware queue 2018-05-10 11:27:46 -06:00
Makefile
mq-deadline.c mq-deadline: Make sure to always unlock zones 2018-03-01 08:39:24 -07:00
noop-iosched.c
opal_proto.h
partition-generic.c blk-mq: fix sysfs inflight counter 2018-04-26 09:02:01 -06:00
scsi_ioctl.c block: consistently use GFP_NOIO instead of __GFP_NORECLAIM 2018-05-14 08:55:18 -06:00
sed-opal.c for-4.17/block-20180402 2018-04-05 14:27:02 -07:00
t10-pi.c