Skip to content

dm-rq: improve sequential I/O performance

Ming Lei dm-devel linux-block 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 32 repliesIn review
  2. v25 patches 2 repliesSuperseded
  3. v15 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- rebase on the latest for-4.16/block of block tree
- add missed pg_init_all_paths() in patch 1, according to Bart's review

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5dm-mpath: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCEdrivers/md/dm-mpath.c drivers/md/dm-rq.c+2 -40 replies
2/5dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failuredrivers/md/dm-mpath.c+13 -12 replies
3/5blk-mq: move actual issue into one helperblock/blk-mq.c+27 -121 reply
4/5blk-mq: return dispatch result to caller in blk_mq_try_issue_directlyblock/blk-mq.c+14 -91 reply
5/5blk-mq: issue request directly for blk_insert_cloned_requestblock/blk-core.c block/blk-mq.c block/blk-mq.h +1 more+50 -91 reply

Reviews trailers per patch

3 of 5 patches have a Reviewed-by or Acked-by.

PatchMike Snitzer
1/5
2/5
3/5R-b
4/5R-b
5/5T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH V3 0/5] dm-rq: improve sequential I/O performance

Hi Guys,

The 1st patch removes the workaround of blk_mq_delay_run_hw_queue() in case of requeue, this way isn't necessary, and more worse, it makes BLK_MQ_S_SCHED_RESTART not working, and degarde I/O performance.

The 2nd patch return DM_MAPIO_REQUEUE to dm-rq if underlying request allocation fails, then we can return BLK_STS_RESOURCE from dm-rq to blk-mq, so that blk-mq can hold the requests to be dequeued.

The other 3 paches changes the blk-mq part of blk_insert_cloned_request(), in which we switch to blk_mq_try_issue_directly(), so that both dm-rq and blk-mq can get the dispatch result of underlying queue, and with this information, blk-mq can handle IO merge much better, then sequential I/O performance is improved much.

In my dm-mpath over virtio-scsi test, this whole patchset improves sequential IO by 3X ~ 5X.

V3:
- rebase on the latest for-4.16/block of block tree
- add missed pg_init_all_paths() in patch 1, according to Bart's review

V2:
- drop 'dm-mpath: cache ti->clone during requeue', which is a bit too complicated, and not see obvious performance improvement.
- make change on blk-mq part cleaner

Ming Lei (5):
dm-mpath: don't call blk_mq_delay_run_hw_queue() in case of
BLK_STS_RESOURCE
dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure
blk-mq: move actual issue into one helper
blk-mq: return dispatch result to caller in blk_mq_try_issue_directly
blk-mq: issue request directly for blk_insert_cloned_request

 block/blk-core.c      |  3 +-
 block/blk-mq.c        | 86 +++++++++++++++++++++++++++++++++++++++------------
 block/blk-mq.h        |  3 ++
 drivers/md/dm-mpath.c | 19 +++++++++---
 drivers/md/dm-rq.c    | 20 +++++++++---
 5 files changed, 101 insertions(+), 30 deletions(-)
Signature · 1 line
2.9.5