Skip to content

blk-mq: support batching dispatch from scheduler

Ming Lei linux-block 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest6 patches 2 repliesIn review
  2. v66 patches 7 repliesSuperseded
  3. v56 patches 2 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v46 patches6 repliesSuperseded
v36 patches4 repliesSuperseded
v26 patches6 repliesSuperseded
v19 patches24 repliesSuperseded

Changes in v7 from the cover letter

- add reviewed-by tag
- take Christoph's suggestion about implementation on 6/6

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6blk-mq: pass request queue into get/put budget callbackblock/blk-mq-sched.c block/blk-mq.c block/blk-mq.h +2 more+17 -230 replies
2/6blk-mq: pass hctx to blk_mq_dispatch_rq_listblock/blk-mq-sched.c block/blk-mq.c block/blk-mq.h+10 -120 replies
3/6blk-mq: move getting driver tag and budget into one helperblock/blk-mq.c+40 -260 replies
4/6blk-mq: remove dead check from blk_mq_dispatch_rq_listblock/blk-mq.c+0 -70 replies
5/6blk-mq: pass obtained budget count to blk_mq_dispatch_rq_listblock/blk-mq-sched.c block/blk-mq.c block/blk-mq.h+33 -90 replies
6/6blk-mq: support batching dispatch in case of ioblock/blk-mq-sched.c block/blk-mq.c+82 -91 reply

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchJohannes ThumshirnChristoph HellwigDouglas AndersonSagi GrimbergBaolin Wang
1/6R-b R-b R-b R-b T-b
2/6R-b R-b R-b T-b
3/6R-b R-b R-b T-b
4/6R-b R-b R-b T-b
5/6R-b T-b
6/6R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v7 thread

Cover letter [PATCH V7 0/6] blk-mq: support batching dispatch from scheduler

Hi Jens,

More and more drivers want to get batching requests queued from block layer, such as mmc[1], and tcp based storage drivers[2]. 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.

Tries to start the support by dequeuing more requests from scheduler if budget is enough and device isn't busy.

Simple fio test over virtio-scsi shows IO can get improved by 5~10%.

Baolin has tested previous versions and found performance on MMC can be improved.

Patch 1 ~ 4 are improvement and cleanup, which can't applied without supporting batching dispatch.

Patch 5 ~ 6 starts to support batching dispatch from scheduler.

[1] https://lore.kernel.org/linux-block/20200512075501.GF1531898@T590/#r
[2] https://lore.kernel.org/linux-block/[email protected]/

V7:
- add reviewed-by tag
- take Christoph's suggestion about implementation on 6/6

V6:
- rebase on for-5.9/block, only 1st patch is changed

V5:
- code style changes suggested by Damien

V4:
- fix releasing budgets and avoids IO hang(5/6)
- dispatch more batches if the device can accept more(6/6)
- verified by running more tests

V3:
- add reviewed-by tag
- fix one typo
- fix one budget leak issue in case that .queue_rq returned *_RESOURCE in 5/6

V2:
- remove 'got_budget' from blk_mq_dispatch_rq_list
- drop patch for getting driver tag & handling partial dispatch

Ming Lei (6):
blk-mq: pass request queue into get/put budget callback
blk-mq: pass hctx to blk_mq_dispatch_rq_list
blk-mq: move getting driver tag and budget into one helper
blk-mq: remove dead check from blk_mq_dispatch_rq_list
blk-mq: pass obtained budget count to blk_mq_dispatch_rq_list
blk-mq: support batching dispatch in case of io

 block/blk-mq-sched.c    | 103 +++++++++++++++++++++++++++++++------
 block/blk-mq.c          | 110 +++++++++++++++++++++++++---------------
 block/blk-mq.h          |  15 +++---
 drivers/scsi/scsi_lib.c |   8 ++-
 include/linux/blk-mq.h  |   4 +-
 5 files changed, 168 insertions(+), 72 deletions(-)
Cc Sagi Grimberg <[email protected]>
Cc Baolin Wang <[email protected]>
Cc Christoph Hellwig <[email protected]>
Signature · 1 line
2.25.2