Skip to content

blk-mq/scsi: Provide hostwide shared tags for SCSI HBAs

John Garry linux-block linux-scsi lkml 5 versions – Applied

Status from this message: I applied 1-11, leaving the SCSI core bits and drivers to Martin. I can

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest18 patches 39 repliesApplied
  2. v7 RFC12 patches 110 repliesSuperseded
  3. v6 RFC10 patches 24 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 RFC5 patches3 repliesSuperseded
v1 RFC5 patches16 repliesSuperseded

Patches in v8 Applied

#Subject and filesSizeRepliesApplied
1/18blk-mq: Rename BLK_MQ_F_TAG_SHARED as BLK_MQ_F_TAG_QUEUE_SHAREDblock/blk-mq-debugfs.c block/blk-mq-tag.h block/blk-mq.c +2 more+16 -160 replies
2/18blk-mq: Rename blk_mq_update_tag_set_depth()block/blk-mq.c+4 -40 replies
3/18blk-mq: Free tags in blk_mq_init_tags() upon errorblock/blk-mq-tag.c+10 -80 replies
4/18blk-mq: Pass flags for tag init/freeblock/blk-mq-sched.c block/blk-mq-tag.c block/blk-mq-tag.h +2 more+35 -230 replies
5/18blk-mq: Use pointers for blk_mq_tags bitmap tagsblock/bfq-iosched.c block/blk-mq-debugfs.c block/blk-mq-tag.c +3 more+39 -330 replies
6/18blk-mq: Facilitate a shared sbitmap per tagsetblock/blk-mq-sched.c block/blk-mq-tag.c block/blk-mq-tag.h +3 more+85 -70 replies
7/18blk-mq: Relocate hctx_may_queue()block/blk-mq-tag.h block/blk-mq.h+32 -330 replies
8/18blk-mq: Record nr_active_requests per queue for when using shared sbitmapblock/blk-core.c block/blk-mq.c block/blk-mq.h +1 more+30 -40 replies
9/18blk-mq: Record active_queues_shared_sbitmap per tag_set for when using shared sbitmapblock/blk-mq-tag.c block/blk-mq.c block/blk-mq.h +2 more+42 -110 replies
10/18blk-mq, elevator: Count requests per hctx to improve performanceblock/bfq-iosched.c block/blk-mq.c block/mq-deadline.c +1 more+16 -00 replies
11/18null_blk: Support shared tag bitmapdrivers/block/null_blk_main.c+6 -00 replies
12/18scsi: Add host and host template flag 'host_tagset'drivers/scsi/hosts.c drivers/scsi/scsi_lib.c include/scsi/scsi_host.h+11 -10 replies
13/18scsi: core: Show nr_hw_queues in sysfsdrivers/scsi/scsi_sysfs.c+11 -01 reply
14/18scsi: hisi_sas: Switch v3 hw to MQdrivers/scsi/hisi_sas/hisi_sas.h drivers/scsi/hisi_sas/hisi_sas_main.c drivers/scsi/hisi_sas/hisi_sas_v3_hw.c+56 -700 replies
15/18scsi: scsi_debug: Support host tagsetdrivers/scsi/scsi_debug.c+10 -180 replies
16/18hpsa: enable host_tagset and switch to MQdrivers/scsi/hpsa.c drivers/scsi/hpsa.h+7 -380 replies
17/18scsi: megaraid_sas: Added support for shared host tagset for cpuhotplugdrivers/scsi/megaraid/megaraid_sas_base.c drivers/scsi/megaraid/megaraid_sas_fusion.c+55 -1322 replies
18/18smartpqi: enable host tagsetdrivers/scsi/smartpqi/smartpqi_init.c+31 -140 replies

Reviews trailers per patch

3 of 18 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDon BraceHannes ReineckeDouglas GilbertMartin K. Petersen
SeriesT-b A-b
1/18R-b
2/18
3/18
4/18
5/18T-b R-b
6/18T-b
7/18
8/18T-b
9/18T-b
10/18
11/18
12/18T-b
13/18
14/18
15/18
16/18R-b
17/18
18/18

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

Read the v8 thread

Cover letter [PATCH v8 00/18] blk-mq/scsi: Provide hostwide shared tags for SCSI HBAs

Hi all,

Here is v8 of the patchset.

In this version of the series, we keep the shared sbitmap for driver tags, and introduce changes to fix up the tag budgeting across request queues. We also have a change to count requests per-hctx for when an elevator is enabled, as an optimisation. I also dropped the debugfs changes - more on that below.

Some performance figures:

Using 12x SAS SSDs on hisi_sas v3 hw. mq-deadline results are included, but it is not always an appropriate scheduler to use.

Tag depth 4000 (default) 260**

Baseline (v5.9-rc1):
none sched: 2094K IOPS 513K
mq-deadline sched: 2145K IOPS 1336K

Final, host_tagset=0 in LLDD *, ***:
none sched: 2120K IOPS 550K
mq-deadline sched: 2121K IOPS 1309K

Final ***:
none sched: 2132K IOPS 1185
mq-deadline sched: 2145K IOPS 2097

* this is relevant as this is the performance in supporting but not enabling the feature
** depth=260 is relevant as some point where we are regularly waiting for
tags to be available. Figures were are a bit unstable here.
*** Included "[PATCH V4] scsi: core: only re-run queue in
scsi_end_request() if device queue is busy"

A copy of the patches can be found here:
https://github.com/hisilicon/kernel-dev/tree/private-topic-blk-mq-shared-tags-v8

The hpsa patch depends on:
https://lore.kernel.org/linux-scsi/[email protected]/

And the smartpqi patch is not to be accepted.

Comments (and testing) welcome, thanks!

Differences to v7:
- Add null_blk and scsi_debug support
- Drop debugfs tags patch - it's too difficult to be the same between hostwide and non-hostwide, as discussed:
https://lore.kernel.org/linux-scsi/[email protected]/T/#mb3eb462d8be40273718505989abd12f8228c15fd
And from commit 6bf0eb550452 ("sbitmap: Consider cleared bits in sbitmap_bitmap_show()"), I guess not many used this anyway...
- Add elevator per-hctx request count for optimisation
- Break up "blk-mq: rename blk_mq_update_tag_set_depth()" into 2x patches
- Pass flags for avoid per-hq queue tags init/free for hostwide tags
- Add Don's reviewed-tag and tested-by tags to appropiate patches
- (@Don, please let me know if issue with how I did this)
- Add "scsi: core: Show nr_hw_queues in sysfs"
- Rework megaraid SAS patch to have module param (Kashyap)
- rebase

V7 is here for more info:
https://lore.kernel.org/linux-scsi/[email protected]/T/#t

Hannes Reinecke (5):
blk-mq: Rename blk_mq_update_tag_set_depth()
blk-mq: Free tags in blk_mq_init_tags() upon error
scsi: Add host and host template flag 'host_tagset'
hpsa: enable host_tagset and switch to MQ
smartpqi: enable host tagset

John Garry (10):
blk-mq: Pass flags for tag init/free
blk-mq: Use pointers for blk_mq_tags bitmap tags
blk-mq: Facilitate a shared sbitmap per tagset
blk-mq: Relocate hctx_may_queue()
blk-mq: Record nr_active_requests per queue for when using shared
sbitmap
blk-mq: Record active_queues_shared_sbitmap per tag_set for when using
shared sbitmap
null_blk: Support shared tag bitmap
scsi: core: Show nr_hw_queues in sysfs
scsi: hisi_sas: Switch v3 hw to MQ
scsi: scsi_debug: Support host tagset

Kashyap Desai (2):
blk-mq, elevator: Count requests per hctx to improve performance
scsi: megaraid_sas: Added support for shared host tagset for
cpuhotplug

Ming Lei (1):
blk-mq: Rename BLK_MQ_F_TAG_SHARED as BLK_MQ_F_TAG_QUEUE_SHARED

 block/bfq-iosched.c                         |   9 +-
 block/blk-core.c                            |   2 +
 block/blk-mq-debugfs.c                      |  10 +-
 block/blk-mq-sched.c                        |  13 +-
 block/blk-mq-tag.c                          | 149 ++++++++++++++------
 block/blk-mq-tag.h                          |  56 +++-----
 block/blk-mq.c                              |  81 +++++++----
 block/blk-mq.h                              |  76 +++++++++-
 block/kyber-iosched.c                       |   4 +-
 block/mq-deadline.c                         |   6 +
 drivers/block/null_blk_main.c               |   6 +
 drivers/block/rnbd/rnbd-clt.c               |   2 +-
 drivers/scsi/hisi_sas/hisi_sas.h            |   3 +-
 drivers/scsi/hisi_sas/hisi_sas_main.c       |  36 ++---
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c      |  87 +++++-------
 drivers/scsi/hosts.c                        |   1 +
 drivers/scsi/hpsa.c                         |  44 +-----
 drivers/scsi/hpsa.h                         |   1 -
 drivers/scsi/megaraid/megaraid_sas_base.c   |  39 +++++
 drivers/scsi/megaraid/megaraid_sas_fusion.c |  29 ++--
 drivers/scsi/scsi_debug.c                   |  28 ++--
 drivers/scsi/scsi_lib.c                     |   2 +
 drivers/scsi/scsi_sysfs.c                   |  11 ++
 drivers/scsi/smartpqi/smartpqi_init.c       |  45 ++++--
 include/linux/blk-mq.h                      |  13 +-
 include/linux/blkdev.h                      |   3 +
 include/scsi/scsi_host.h                    |   9 +-
 27 files changed, 484 insertions(+), 281 deletions(-)
Signature · 1 line
2.26.2