kernel_optimize_test/block
Ming Lei 6e6fcbc27e blk-mq: support batching dispatch in case of io
More and more drivers want to get batching requests queued from
block layer, such as mmc, and tcp based storage drivers. Also
current in-tree users have virtio-scsi, virtio-blk and nvme.

For none, we already support batching dispatch.

But for io scheduler, every time we just take one request from scheduler
and pass the single request to blk_mq_dispatch_rq_list(). This way makes
batching dispatch not possible when io scheduler is applied. One reason
is that we don't want to hurt sequential IO performance, becasue IO
merge chance is reduced if more requests are dequeued from scheduler
queue.

Try to support batching dispatch for io scheduler by starting with the
following simple approach:

1) still make sure we can get budget before dequeueing request

2) use hctx->dispatch_busy to evaluate if queue is busy, if it is busy
we fackback to non-batching dispatch, otherwise dequeue as many as
possible requests from scheduler, and pass them to blk_mq_dispatch_rq_list().

Wrt. 2), we use similar policy for none, and turns out that SCSI SSD
performance got improved much.

In future, maybe we can develop more intelligent algorithem for batching
dispatch.

Baolin has tested this patch and found that MMC performance is improved[3].

[1] https://lore.kernel.org/linux-block/20200512075501.GF1531898@T590/#r
[2] https://lore.kernel.org/linux-block/fe6bd8b9-6ed9-b225-f80c-314746133722@grimberg.me/
[3] https://lore.kernel.org/linux-block/CADBw62o9eTQDJ9RvNgEqSpXmg6Xcq=2TxH0Hfxhp29uF2W=TXA@mail.gmail.com/

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Tested-by: Baolin Wang <baolin.wang7@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Baolin Wang <baolin.wang7@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-06-30 07:51:48 -06:00
..
partitions block-5.8-2020-06-19 2020-06-19 13:11:26 -07:00
badblocks.c
bfq-cgroup.c block, bfq: invoke flush_idle_tree after reparent_active_queues in pd_offline 2020-03-21 14:31:03 -06:00
bfq-iosched.c blk-mq: remove the bio argument to ->prepare_request 2020-05-29 10:23:24 -06:00
bfq-iosched.h block, bfq: turn put_queue into release_process_ref in __bfq_bic_change_cgroup 2020-03-21 14:31:00 -06:00
bfq-wf2q.c block, bfq: get a ref to a group when adding it to a service tree 2020-02-03 06:58:15 -07:00
bio-integrity.c block/bio-integrity: don't free 'buf' if bio_integrity_add_page() failed 2020-06-02 17:21:50 -06:00
bio.c block: move the bio cgroup associatation helpers to blk-cgroup.c 2020-06-29 09:09:08 -06:00
blk-cgroup-rwstat.c blk-cgroup: separate out blkg_rwstat under CONFIG_BLK_CGROUP_RWSTAT 2019-11-07 12:28:13 -07:00
blk-cgroup-rwstat.h blk-cgroup: separate out blkg_rwstat under CONFIG_BLK_CGROUP_RWSTAT 2019-11-07 12:28:13 -07:00
blk-cgroup.c blk-cgroup: remove blkcg_bio_issue_check 2020-06-29 09:09:08 -06:00
blk-core.c blk-cgroup: remove blkcg_bio_issue_check 2020-06-29 09:09:08 -06:00
blk-crypto-fallback.c block: blk-crypto-fallback: remove redundant initialization of variable err 2020-05-27 05:41:59 -06:00
blk-crypto-internal.h block: blk-crypto-fallback for Inline Encryption 2020-05-14 09:48:03 -06:00
blk-crypto.c block: blk-crypto-fallback for Inline Encryption 2020-05-14 09:48:03 -06:00
blk-exec.c block: add a blk_account_io_merge_bio helper 2020-05-27 05:21:23 -06:00
blk-flush.c blk-mq: put driver tag when this request is completed 2020-06-29 09:56:10 -06:00
blk-integrity.c block: Make blk-integrity preclude hardware inline encryption 2020-05-14 09:48:03 -06:00
blk-ioc.c block: Fix use-after-free issue accessing struct io_cq 2020-03-12 07:07:38 -06:00
blk-iocost.c blk-iocost: Use struct_size() in kzalloc_node() 2020-06-24 09:15:58 -06:00
blk-iolatency.c
blk-lib.c
blk-map.c block: Inline encryption support for blk-mq 2020-05-14 09:47:53 -06:00
blk-merge.c blktrace: Provide event for request merging 2020-06-25 21:06:11 -06:00
blk-mq-cpumap.c
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c block: create the request_queue debugfs_dir on registration 2020-06-24 09:15:58 -06:00
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c blk-mq: support batching dispatch in case of io 2020-06-30 07:51:48 -06:00
blk-mq-sched.h
blk-mq-sysfs.c blk-mq: make sure that line break can be printed 2019-11-04 07:14:10 -07:00
blk-mq-tag.c blk-mq: remove the BLK_MQ_REQ_INTERNAL flag 2020-06-29 09:56:18 -06:00
blk-mq-tag.h blk-mq: split out a __blk_mq_get_driver_tag helper 2020-06-07 08:56:50 -06:00
blk-mq-virtio.c blk-mq: Fix typo in comment 2020-03-17 20:55:21 +01:00
blk-mq.c blk-mq: support batching dispatch in case of io 2020-06-30 07:51:48 -06:00
blk-mq.h blk-mq: pass obtained budget count to blk_mq_dispatch_rq_list 2020-06-30 07:51:48 -06:00
blk-pm.c
blk-pm.h
blk-rq-qos.c blk-rq-qos: remove redundant finish_wait to rq_qos_wait. 2020-06-28 08:11:14 -06:00
blk-rq-qos.h
blk-settings.c block: Introduce REQ_OP_ZONE_APPEND 2020-05-12 20:36:28 -06:00
blk-stat.c
blk-stat.h
blk-sysfs.c block: create the request_queue debugfs_dir on registration 2020-06-24 09:15:58 -06:00
blk-throttle.c blk-cgroup: remove a dead check in blk_throtl_bio 2020-06-29 09:09:08 -06:00
blk-timeout.c blk-mq: move failure injection out of blk_mq_complete_request 2020-06-24 09:15:57 -06:00
blk-wbt.c blk-wbt: rename __wbt_update_limits to wbt_update_limits 2020-05-29 16:30:39 -06:00
blk-wbt.h blk-wbt: remove wbt_update_limits 2020-05-29 16:30:39 -06:00
blk-zoned.c block: Modify revalidate zones 2020-05-12 20:36:28 -06:00
blk.h blk-cgroup: remove blkcg_bio_issue_check 2020-06-29 09:09:08 -06:00
bounce.c block: Inline encryption support for blk-mq 2020-05-14 09:47:53 -06:00
bsg-lib.c blk-mq: move failure injection out of blk_mq_complete_request 2020-06-24 09:15:57 -06:00
bsg.c compat_ioctl: bsg: add handler 2020-01-03 09:33:21 +01:00
cmdline-parser.c
elevator.c Merge branch 'for-linus' into for-5.5/block 2019-11-07 12:27:19 -07:00
genhd.c block: revert back to synchronous request_queue removal 2020-06-24 09:15:58 -06:00
ioctl.c block: Fix type of first compat_put_{,u}long() argument 2020-05-19 09:40:29 -06:00
ioprio.c
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Kconfig.iosched treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
keyslot-manager.c block: Make blk-integrity preclude hardware inline encryption 2020-05-14 09:48:03 -06:00
kyber-iosched.c blk-mq: remove the bio argument to ->prepare_request 2020-05-29 10:23:24 -06:00
Makefile blk-mq: merge blk-softirq.c into blk-mq.c 2020-06-24 09:15:56 -06:00
mq-deadline.c blk-mq: remove the bio argument to ->prepare_request 2020-05-29 10:23:24 -06:00
opal_proto.h block: sed-opal: Change the check condition for regular session validity 2020-03-12 08:00:10 -06:00
scsi_ioctl.c scsi: core: Allow non-root users to perform ZBC commands 2020-03-16 18:26:31 -04:00
sed-opal.c block: sed-opal: Change the check condition for regular session validity 2020-03-12 08:00:10 -06:00
t10-pi.c block: Allow t10-pi to be modular 2020-01-06 20:59:04 -07:00