Skip to content

Drop host_lock around LLD SHT->queuecommand() caller

Nicholas A. Bellinger linux-scsi lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 22 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8scsi: Drop struct Scsi_Host->host_lock around SHT->queuecommand()drivers/scsi/scsi.c+2 -112 replies
2/8libiscsi: Remove host_lock unlock() + lock() from iscsi_queuecommand()drivers/scsi/libiscsi.c+0 -40 replies
3/8libsas: Remove host_lock unlock() + lock() from sas_queuecommand()drivers/scsi/libsas/sas_scsi_host.c+0 -50 replies
4/8lpfc: Remove host_lock unlock() + lock() from lpfc_queuecommand()drivers/scsi/lpfc/lpfc_scsi.c+0 -20 replies
5/8qla4xxx: Remove host_lock unlock() + lock() from qla4xxx_queuecommand()drivers/scsi/qla4xxx/ql4_os.c+1 -70 replies
6/8qla2xxx: Remove host_lock unlock() + lock() from qla2xxx_queuecommand()drivers/scsi/qla2xxx/qla_os.c+2 -50 replies
7/8tcm_loop: Remove host_lock unlock() + lock() from tcm_loop_queuecommand()drivers/target/tcm_loop/tcm_loop_fabric_scsi.c+0 -70 replies
8/8libfc: Remove host_lock unlock() + lock() from fc_queuecommand()drivers/scsi/libfc/fc_fcp.c+1 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/8] Drop host_lock around LLD SHT->queuecommand() caller

From: Nicholas Bellinger <[email protected]>

Greetings all,

This series contains the first round of a whole-sale conversion for droping struct Scsi_Host->host_lock around struct Scsi_Host->queuecommand() within scsi_dispatch_cmd(). So with this first patch the only part of scsi_dispatch_cmd() that is protected by host_lock is scsi_cmd_get_serial)_.

The patches #2 -> #8 converts libiscsi, libsas, lpfc, qla4xxx, qla2xxx, TCM_Loop, and libfc code to drop their own SHT->queuecommand() internal host_lock unlock() + lock() optimization that certain high performance libs and LLDs have adopted over the years. The changes involved here are really quite straight forward, but please note that none of this code has been tested with actual hardware yet, and is intended for generating comments for the relivent SCSI LLD driver maintainers and other interested folks.

There are probably still be more LLDs which use this optimization, so please let me know if there is another piece of SHT->queuecommand() caller code that does this legacy optimization and needs to be updated. I will be sure to CC the right driver maintainers and CC linux-scsi as I come across any more conversions.

Many thanks to Vasu Dev and Tim Chen for their work in this area!!

Nicholas Bellinger (8):
scsi: Drop struct Scsi_Host->host_lock around SHT->queuecommand()
libiscsi: Remove host_lock unlock() + lock() from
iscsi_queuecommand()
libsas: Remove host_lock unlock() + lock() from sas_queuecommand()
lpfc: Remove host_lock unlock() + lock() from lpfc_queuecommand()
qla4xxx: Remove host_lock unlock() + lock() from
qla4xxx_queuecommand()
qla2xxx: Remove host_lock unlock() + lock() from
qla2xxx_queuecommand()
tcm_loop: Remove host_lock unlock() + lock() from
tcm_loop_queuecommand()
libfc: Remove host_lock unlock() + lock() from fc_queuecommand()

 drivers/scsi/libfc/fc_fcp.c                    |    5 +----
 drivers/scsi/libiscsi.c                        |    4 ----
 drivers/scsi/libsas/sas_scsi_host.c            |    5 -----
 drivers/scsi/lpfc/lpfc_scsi.c                  |    2 --
 drivers/scsi/qla2xxx/qla_os.c                  |    7 ++-----
 drivers/scsi/qla4xxx/ql4_os.c                  |    8 +-------
 drivers/scsi/scsi.c                            |    3 ++-
 drivers/target/tcm_loop/tcm_loop_fabric_scsi.c |    7 -------
 8 files changed, 6 insertions(+), 35 deletions(-)
Signature · 1 line
1.7.2.3