linux/drivers/scsi
Martin K. Petersen dc70c9615c Merge patch series "Fix shost command overloading issues"
John Garry <john.g.garry@oracle.com> says:

It's easy to get scsi_debug to error on throughput testing when we have
multiple shosts:

$ lsscsi
[7:0:0:0]       disk    Linux   scsi_debug      0191
[0:0:0:0]       disk    Linux   scsi_debug      0191

$ fio --filename=/dev/sda --filename=/dev/sdb --direct=1 --rw=read
--bs=4k --iodepth=256 --runtime=60 --numjobs=40 --time_based --name=jpg
--eta-newline=1 --readonly --ioengine=io_uring --hipri --exitall_on_error
jpg: (g=0): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=io_uring, iodepth=256
...
fio-3.28
Starting 40 processes
[   27.521809] hrtimer: interrupt took 33067 ns
[   27.904660] sd 7:0:0:0: [sdb] tag#171 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK cmd_age=0s
[   27.904660] sd 0:0:0:0: [sda] tag#58 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK cmd_age=0s
fio: io_u error [   27.904667] sd 0:0:0:0: [sda] tag#58 CDB: Read(10) 28 00 00 00 27 00 00 01 18 00
on file /dev/sda[   27.904670] sd 0:0:0:0: [sda] tag#62 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK cmd_age=0s

The issue is related to how the driver manages submit queues and tags. A
single array of submit queues - sdebug_q_arr - with its own set of tags is
shared among all shosts. As such, for occasions when we have more than one
host it is possible to overload the submit queues and run out of tags.

Another separate issue that we may reduce the shost submit queue depth,
sdebug_max_queue, dynamically causing the shost to be overloaded. How many
IOs which the shost may be sent is fixed at can_queue at init time, which
is the same initial value for sdebug_max_queue. So reducing
sdebug_max_queue means that the shost may be sent more IOs than it is
configured to handle, causing overloading.

This series removes the scsi_debug submit queue concept and uses
pre-existing APIs to manage and examine tags, like scsi_block_requests()
and blk_mq_tagset_busy_iter(). Using standard APIs makes the driver more
maintainable and extensible in future.

A restriction is also added to allow sdebug_max_queue only be modified when
no shosts are present, i.e. we need to remove shosts, modify
sdebug_max_queue, and then re-add the shosts.

Link: https://lore.kernel.org/r/20230327074310.1862889-1-john.g.garry@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-04-02 22:10:40 -04:00
..
aacraid Merge patch series "Constify most SCSI host templates" 2023-03-24 20:13:03 -04:00
aic7xxx scsi: aic79xx: Use __ro_after_init explicitly 2022-09-15 22:01:24 -04:00
aic94xx scsi: aic94xx: Declare SCSI host template const 2023-03-24 19:19:21 -04:00
arcmsr Merge patch series "Constify most SCSI host templates" 2023-03-24 20:13:03 -04:00
arm scsi: powertec: Declare SCSI host template const 2023-03-24 19:19:21 -04:00
be2iscsi Merge patch series "Constify most SCSI host templates" 2023-03-24 20:13:03 -04:00
bfa scsi: bfa: Drop redundant pci_enable_pcie_error_reporting() 2023-03-09 22:00:38 -05:00
bnx2fc scsi: bnx2fc: Avoid using get_cpu() in bnx2fc_cmd_alloc() 2022-05-16 21:26:50 -04:00
bnx2i scsi: iscsi: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
csiostor scsi: csiostor: Remove unnecessary aer.h include 2023-03-09 22:00:38 -05:00
cxgbi scsi: iscsi: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
cxlflash - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08:00
device_handler scsi: scsi_dh_alua: Fix memleak for 'qdata' in alua_activate() 2023-03-16 23:02:23 -04:00
elx Merge patch series "Constify most SCSI host templates" 2023-03-24 20:13:03 -04:00
esas2r scsi: esas2r: Declare SCSI host template const 2023-03-24 19:19:22 -04:00
fcoe scsi: fcoe: Declare SCSI host template const 2023-03-24 19:19:22 -04:00
fnic Merge patch series "Constify most SCSI host templates" 2023-03-24 20:13:03 -04:00
hisi_sas Merge patch series "scsi: hisi_sas: Some misc changes" 2023-04-02 21:58:22 -04:00
ibmvscsi scsi: ibmvfc: Declare SCSI host template const 2023-03-24 19:19:56 -04:00
ibmvscsi_tgt scsi: ibmvscsit: Remove default fabric ops callouts 2023-03-16 23:36:36 -04:00
isci scsi: isci: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
libfc scsi: libfc: Include the correct header 2022-12-01 03:03:36 +00:00
libsas scsi: libsas: Abort all in-flight requests when device is gone 2023-04-02 21:19:12 -04:00
lpfc Merge branch '6.3/scsi-fixes' into 6.4/scsi-staging 2023-03-31 21:45:14 -04:00
megaraid Merge branch '6.3/scsi-fixes' into 6.4/scsi-staging 2023-03-31 21:45:14 -04:00
mpi3mr Merge branch '6.3/scsi-fixes' into 6.4/scsi-staging 2023-03-31 21:45:14 -04:00
mpt3sas Merge branch '6.3/scsi-fixes' into 6.4/scsi-staging 2023-03-31 21:45:14 -04:00
mvsas scsi: mvsas: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
pcmcia scsi: pcmcia-sym53c500: Declare SCSI host template const 2023-03-24 19:19:58 -04:00
pm8001 scsi: pcmcia-pm8001: Declare SCSI host template const 2023-03-24 19:19:58 -04:00
qedf scsi: qedf: Remove unused 'num_handled' variable 2023-04-02 21:45:46 -04:00
qedi scsi: iscsi: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
qla2xxx Merge branch '6.3/scsi-fixes' into 6.4/scsi-staging 2023-03-31 21:45:14 -04:00
qla4xxx scsi: qla4xxx: Remove unused 'count' variable 2023-04-02 21:48:46 -04:00
smartpqi scsi: smartpqi: Declare SCSI host template const 2023-03-24 19:19:59 -04:00
snic scsi: snic: Remove unused 'xfer_len' variable 2023-04-02 21:47:36 -04:00
sym53c8xx_2 scsi: sym53c8xx: Declare SCSI host template const 2023-03-24 19:19:59 -04:00
.gitignore
3w-9xxx.c scsi: 3w-9xxx: Declare SCSI host template const 2023-03-24 19:19:20 -04:00
3w-9xxx.h
3w-sas.c scsi: 3w-sas: Declare SCSI host template const 2023-03-24 19:19:20 -04:00
3w-sas.h scsi: 3w-sas: Replace 1-element arrays with flexible array members 2023-01-12 00:09:52 -05:00
3w-xxxx.c scsi: 3w-xxxx: Declare SCSI host template const 2023-03-24 19:19:20 -04:00
3w-xxxx.h scsi: 3w-xxxx: Replace one-element array with flexible-array member 2022-09-25 13:06:00 -04:00
53c700_d.h_shipped
53c700.c scsi: 53c700: Stop clearing SCSI pointer fields 2022-02-22 21:11:03 -05:00
53c700.h
53c700.scr
a100u2w.c scsi: a100u2w: Declare SCSI host template const 2023-03-24 19:19:20 -04:00
a100u2w.h
a2091.c scsi: a2091: Declare SCSI host template const 2023-03-24 19:19:20 -04:00
a2091.h
a3000.c scsi: a3000: Declare SCSI host template const 2023-03-24 19:19:20 -04:00
a3000.h
a4000t.c
advansys.c scsi: advansys: Declare SCSI host template const 2023-03-24 19:19:20 -04:00
aha152x.c scsi: aha152x: Declare SCSI host template const 2023-03-24 19:19:20 -04:00
aha152x.h
aha1542.c scsi: aha1542: Declare SCSI host template const 2023-03-24 19:19:21 -04:00
aha1542.h
aha1740.c scsi: aha1740: Declare SCSI host template const 2023-03-24 19:19:21 -04:00
aha1740.h
am53c974.c scsi: esp_scsi: Declare SCSI host template const 2023-03-24 19:19:22 -04:00
atari_scsi.c scsi: NCR5380: Add SCp members to struct NCR5380_cmd 2022-02-22 21:11:03 -05:00
atp870u.c scsi: atp870u: Declare SCSI host template const 2023-03-24 19:19:21 -04:00
atp870u.h
BusLogic.c scsi: BusLogic: Declare SCSI host template const 2023-03-24 19:19:20 -04:00
BusLogic.h
bvme6000_scsi.c
ch.c scsi: ch: Convert to scsi_execute_cmd() 2023-01-13 21:34:08 -05:00
constants.c
dc395x.c scsi: dc395x: Declare SCSI host template const 2023-03-24 19:19:21 -04:00
dc395x.h
dmx3191d.c scsi: dmx3191d: Declare SCSI host template const 2023-03-24 19:19:22 -04:00
esp_scsi.c scsi: esp_scsi: Declare SCSI host template const 2023-03-24 19:19:22 -04:00
esp_scsi.h scsi: esp_scsi: Declare SCSI host template const 2023-03-24 19:19:22 -04:00
fdomain_isa.c
fdomain_pci.c
fdomain.c scsi: fdomain: Declare SCSI host template const 2023-03-24 19:19:22 -04:00
fdomain.h
FlashPoint.c scsi: FlashPoint: Remove redundant variable bm_int_st 2022-08-01 19:52:03 -04:00
g_NCR5380.c scsi: NCR5380: Declare SCSI host template const 2023-03-24 19:19:22 -04:00
gvp11.c scsi: gvp11: Declare SCSI host template const 2023-03-24 19:19:22 -04:00
gvp11.h
hosts.c Merge branch '6.3/scsi-fixes' into 6.4/scsi-staging 2023-03-31 21:45:14 -04:00
hpsa_cmd.h
hpsa.c Merge patch series "Constify most SCSI host templates" 2023-03-24 20:13:03 -04:00
hpsa.h
hptiop.c scsi: hptiop: Declare SCSI host template const 2023-03-24 19:19:56 -04:00
hptiop.h scsi: hptiop: Replace one-element array with flexible-array member in struct hpt_iop_request_ioctl_command() 2022-09-25 13:04:17 -04:00
imm.c scsi: imm: Declare SCSI host template const 2023-03-24 19:19:56 -04:00
imm.h scsi: imm: Move the SCSI pointer to private command data 2022-02-22 21:11:04 -05:00
initio.c scsi: initio: Declare SCSI host template const 2023-03-24 19:19:56 -04:00
initio.h scsi: initio: Stop using the SCSI pointer 2022-02-22 21:11:05 -05:00
ipr.c scsi: ipr: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
ipr.h
ips.c scsi: ips: Replace kmap_atomic() with kmap_local_page() 2023-01-18 18:41:12 -05:00
ips.h
iscsi_boot_sysfs.c
iscsi_tcp.c scsi: iscsi: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
iscsi_tcp.h scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername() 2022-09-25 14:27:47 -04:00
jazz_esp.c scsi: esp_scsi: Declare SCSI host template const 2023-03-24 19:19:22 -04:00
Kconfig scsi: core: Make SCSI_MOD depend on BLOCK for cleaner .config files 2022-09-25 12:46:59 -04:00
lasi700.c
libiscsi_tcp.c scsi: iscsi: Remove iscsi_get_task back_lock requirement 2022-06-21 21:19:23 -04:00
libiscsi.c scsi: iscsi: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
mac53c94.c scsi: mac53c94: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
mac53c94.h scsi: mac53c94: Stop using struct scsi_pointer 2022-02-27 21:35:30 -05:00
mac_esp.c scsi: esp_scsi: Declare SCSI host template const 2023-03-24 19:19:22 -04:00
mac_scsi.c scsi: NCR5380: Add SCp members to struct NCR5380_cmd 2022-02-22 21:11:03 -05:00
Makefile scsi: dpt_i2o: Remove obsolete driver 2022-06-27 22:56:21 -04:00
megaraid.c scsi: megaraid: Fix mega_cmd_done() CMDID_INT_CMDS 2023-03-24 20:27:17 -04:00
megaraid.h scsi: megaraid: Stop using the SCSI pointer 2022-02-22 21:11:05 -05:00
mesh.c scsi: mesh: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
mesh.h scsi: mesh: Stop using struct scsi_pointer 2022-02-27 21:34:02 -05:00
mvme16x_scsi.c
mvme147.c scsi: mvme147: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
mvme147.h
mvumi.c scsi: mvumi: Declare SCSI host template const 2023-03-24 19:19:58 -04:00
mvumi.h scsi: mvumi: Replace 1-element arrays with flexible array members 2023-01-12 00:11:11 -05:00
myrb.c scsi: myrb: Declare SCSI host template const 2023-03-24 19:19:58 -04:00
myrb.h
myrs.c scsi: myrs: Declare SCSI host template const 2023-03-24 19:19:58 -04:00
myrs.h
ncr53c8xx.c scsi: zalon: Stop using the SCSI pointer 2022-02-22 21:11:07 -05:00
ncr53c8xx.h scsi: zalon: Stop using the SCSI pointer 2022-02-22 21:11:07 -05:00
NCR5380.c scsi: NCR5380: Fix repeated words in comment 2022-11-08 02:57:01 +00:00
NCR5380.h scsi: NCR5380: Add SCp members to struct NCR5380_cmd 2022-02-22 21:11:03 -05:00
nsp32_debug.c
nsp32_io.h
nsp32.c scsi: nsp32: Declare SCSI host template const 2023-03-24 19:19:58 -04:00
nsp32.h scsi: nsp32: Stop using the SCSI pointer 2022-02-22 21:11:06 -05:00
pmcraid.c scsi: pmcraid: Declare SCSI host template const 2023-03-24 19:19:58 -04:00
pmcraid.h scsi: pmcraid: Remove the PMCRAID_PASSTHROUGH_IOCTL ioctl implementation 2022-03-29 23:32:26 -04:00
ppa.c scsi: ppa: Declare SCSI host template const 2023-03-24 19:19:58 -04:00
ppa.h
ps3rom.c scsi: ps3rom: Declare SCSI host template const 2023-03-24 19:19:58 -04:00
qla1280.c scsi: qla1280: Declare SCSI host template const 2023-03-24 19:19:59 -04:00
qla1280.h scsi: qla1280: Move the SCSI pointer to private command data 2022-02-22 21:11:06 -05:00
qlogicfas408.c scsi: Remove drivers/scsi/scsi.h 2022-02-22 21:11:02 -05:00
qlogicfas408.h
qlogicfas.c scsi: Remove drivers/scsi/scsi.h 2022-02-22 21:11:02 -05:00
qlogicpti.c Merge patch series "Constify most SCSI host templates" 2023-03-24 20:13:03 -04:00
qlogicpti.h
raid_class.c
script_asm.pl
scsi_bsg.c scsi: bsg: Drop needless assignment in scsi_bsg_sg_io_fn() 2022-03-15 14:05:02 -04:00
scsi_common.c
scsi_debug.c Merge patch series "Fix shost command overloading issues" 2023-04-02 22:10:40 -04:00
scsi_debugfs.c scsi: core: Remove struct scsi_request 2022-03-01 22:21:50 -05:00
scsi_debugfs.h
scsi_devinfo.c scsi: core: Add BLIST_SKIP_VPD_PAGES for SKhynix H28U74301AMR 2023-03-16 22:54:43 -04:00
scsi_dh.c
scsi_error.c scsi: core: Declare most SCSI host template pointers const 2023-03-24 19:19:19 -04:00
scsi_ioctl.c scsi: core: Convert to scsi_execute_cmd() 2023-01-13 21:34:09 -05:00
scsi_lib_dma.c
scsi_lib.c scsi: core: Extend struct scsi_exec_args 2023-02-21 22:00:51 -05:00
scsi_logging.c scsi: core: scsi_logging: Fix a BUG 2022-03-29 23:29:19 -04:00
scsi_logging.h
scsi_netlink.c
scsi_pm.c scsi: block: pm: Always set request queue runtime active in blk_post_runtime_resume() 2021-12-22 23:38:29 -05:00
scsi_priv.h scsi: core: Introduce a new list for SCSI proc directory entries 2022-10-18 03:17:09 +00:00
scsi_proc.c scsi: core: Introduce a new list for SCSI proc directory entries 2022-10-18 03:17:09 +00:00
scsi_sas_internal.h
scsi_scan.c scsi: core: Add BLIST_NO_VPD_SIZE for some VDASD 2023-03-09 20:57:58 -05:00
scsi_sysctl.c
scsi_sysfs.c scsi: core: Declare most SCSI host template pointers const 2023-03-24 19:19:19 -04:00
scsi_trace.c
scsi_transport_api.h
scsi_transport_fc.c scsi: scsi_transport_fc: Remove unused 'desc_cnt' variable 2023-04-02 21:37:57 -04:00
scsi_transport_iscsi.c Merge branch '6.2/scsi-queue' into 6.2/scsi-fixes 2022-12-30 16:29:34 +00:00
scsi_transport_sas.c scsi: scsi_transport_sas: Fix error handling in sas_phy_add() 2022-11-08 01:52:52 +00:00
scsi_transport_spi.c scsi: spi: Convert to scsi_execute_cmd() 2023-01-13 21:34:09 -05:00
scsi_transport_srp.c scsi: core: Change the return type of .eh_timed_out() 2022-10-22 03:25:59 +00:00
scsi.c scsi: core: Improve scsi_vpd_inquiry() checks 2023-03-24 21:01:32 -04:00
scsicam.c scsicam: Fix use of page cache 2022-05-08 14:28:18 -04:00
sd_dif.c scsi: sd: Update DIX config every time sd_revalidate_disk() is called 2023-02-21 22:00:32 -05:00
sd_trace.h scsi: sd: sd_zbc: Trace zone append emulation 2022-12-01 03:13:55 +00:00
sd_zbc.c scsi: sd: Fix wrong zone_write_granularity value during revalidate 2023-03-06 18:33:13 -05:00
sd.c scsi: sd: Fix wrong zone_write_granularity value during revalidate 2023-03-06 18:33:13 -05:00
sd.h scsi: sd: Revert "Rework asynchronous resume support" 2022-08-22 22:45:25 -04:00
sense_codes.h
ses.c scsi: ses: Don't attach if enclosure has no components 2023-02-21 17:44:06 -05:00
sg.c mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
sgiwd93.c scsi: sgiwd93: Declare SCSI host template const 2023-03-24 19:19:59 -04:00
sim710.c
sni_53c710.c
sr_ioctl.c scsi: sr: Convert to scsi_execute_cmd() 2023-01-13 21:34:09 -05:00
sr_vendor.c scsi: sr: Don't use GFP_DMA 2021-12-22 23:41:13 -05:00
sr.c scsi: sr: Simplify the sr_open() function 2023-04-02 21:36:47 -04:00
sr.h sr: implement ->free_disk to simplify refcounting 2022-03-08 19:40:01 -07:00
st_options.h
st.c SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
st.h scsi: don't use disk->private_data to find the scsi_driver 2022-03-08 19:40:00 -07:00
stex.c scsi: stex: Declare SCSI host template const 2023-03-24 19:19:59 -04:00
storvsc_drv.c scsi: storvsc: Handle BlockSize change in Hyper-V VHD/VHDX file 2023-03-06 18:33:13 -05:00
sun3_scsi_vme.c
sun3_scsi.c scsi: NCR5380: Add SCp members to struct NCR5380_cmd 2022-02-22 21:11:03 -05:00
sun3x_esp.c scsi: esp_scsi: Declare SCSI host template const 2023-03-24 19:19:22 -04:00
sun_esp.c Merge patch series "Constify most SCSI host templates" 2023-03-24 20:13:03 -04:00
virtio_scsi.c scsi: virtio-scsi: Declare SCSI host template const 2023-03-24 19:19:59 -04:00
vmw_pvscsi.c scsi: vmw_pvscsi: No need to clear memory after a dma_alloc_coherent() call 2022-04-06 23:01:54 -04:00
vmw_pvscsi.h scsi: vmw_pvscsi: Expand vcpuHint to 16 bits 2022-06-07 21:30:56 -04:00
wd33c93.c scsi: wd33c93: Remove dead code related to the long-gone config WD33C93_PIO 2022-09-25 13:29:53 -04:00
wd33c93.h scsi: wd33c93: Remove dead code related to the long-gone config WD33C93_PIO 2022-09-25 13:29:53 -04:00
wd719x.c scsi: wd719x: Declare SCSI host template const 2023-03-24 19:19:59 -04:00
wd719x.h scsi: wd719x: Stop using the SCSI pointer 2022-02-22 21:11:07 -05:00
xen-scsifront.c scsi: xen-scsifront: Declare SCSI host template const 2023-03-24 19:20:00 -04:00
zalon.c scsi: zalon: Stop using the SCSI pointer 2022-02-22 21:11:07 -05:00
zorro7xx.c scsi: zorro7xx: Fix a resource leak in zorro7xx_remove_one() 2022-03-30 00:05:42 -04:00
zorro_esp.c scsi: esp_scsi: Declare SCSI host template const 2023-03-24 19:19:22 -04:00