linux_old1/drivers/scsi/qla4xxx
Shlomo Pongratz 659743b02c [SCSI] libiscsi: Reduce locking contention in fast path
Replace the session lock with two locks, a forward lock and
a backwards lock named frwd_lock and back_lock respectively.

The forward lock protects resources that change while sending a
request to the target, such as cmdsn, queued_cmdsn, and allocating
task from the commands' pool with kfifo_out.

The backward lock protects resources that change while processing
a response or in error path, such as cmdsn_exp, cmdsn_max, and
returning tasks to the commands' pool with kfifo_in.

Under a steady state fast-path situation, that is when one
or more processes/threads submit IO to an iscsi device and
a single kernel upcall (e.g softirq) is dealing with processing
of responses without errors, this patch eliminates the contention
between the queuecommand()/request response/scsi_done() flows
associated with iscsi sessions.

Between the forward and the backward locks exists a strict locking
hierarchy. The mutual exclusion zone protected by the forward lock can
enclose the mutual exclusion zone protected by the backward lock but not
vice versa.

For example, in iscsi_conn_teardown or in iscsi_xmit_data when there is
a failure and __iscsi_put_task is called, the backward lock is taken while
the forward lock is still taken. On the other hand, if in the RX path a nop
is to be sent, for example in iscsi_handle_reject or __iscsi_complete_pdu
than the forward lock is released and the backward lock is taken for the
duration of iscsi_send_nopout, later the backward lock is released and the
forward lock is retaken.

libiscsi_tcp uses two kernel fifos the r2t pool and the r2t queue.

The insertion and deletion from these queues didn't corespond to the
assumption taken by the new forward/backwards session locking paradigm.

That is, in iscsi_tcp_clenup_task which belongs to the RX (backwards)
path, r2t is taken out from r2t queue and inserted to the r2t pool.
In iscsi_tcp_get_curr_r2t which belong to the TX (forward) path, r2t
is also inserted to the r2t pool and another r2t is pulled from r2t
queue.

Only in iscsi_tcp_r2t_rsp which is called in the RX path but can requeue
to the TX path, r2t is taken from the r2t pool and inserted to the r2t
queue.

In order to cope with this situation, two spin locks were added,
pool2queue and queue2pool. The former protects extracting from the
r2t pool and inserting to the r2t queue, and the later protects the
extracing from the r2t queue and inserting to the r2t pool.

Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
[minor fix up to apply cleanly and compile fix]
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15 10:19:18 -07:00
..
Kconfig [SCSI] qla4xxx: Added support for ISP83XX 2012-09-24 12:11:08 +04:00
Makefile [SCSI] qla4xxx: Added support for ISP83XX 2012-09-24 12:11:08 +04:00
ql4_83xx.c [SCSI] qla4xxx: Use IDC_CTRL bit1 directly instead of AF_83XX_NO_FWDUMP flag. 2014-03-15 10:19:12 -07:00
ql4_83xx.h [SCSI] qla4xxx: Add pex-dma support for capturing minidump 2013-09-03 07:27:56 -07:00
ql4_attr.c [SCSI] qla4xxx: Update Copyright header 2013-09-03 07:27:54 -07:00
ql4_bsg.c [SCSI] qla4xxx: Improve loopback failure messages 2014-03-15 10:19:12 -07:00
ql4_bsg.h [SCSI] qla4xxx: Added support for Diagnostics MBOX command 2013-12-19 20:56:25 -08:00
ql4_dbg.c [SCSI] qla4xxx: Added support for ISP8042 2013-09-03 07:27:53 -07:00
ql4_dbg.h [SCSI] qla4xxx: Fix debug level to avoid floods of same message 2013-04-10 11:47:58 -07:00
ql4_def.h [SCSI] qla4xxx: Driver not able to collect minidump for ISP84xx 2014-03-15 10:19:14 -07:00
ql4_fw.h [SCSI] qla4xxx: Handle IPv6 AEN notifications 2014-03-15 10:19:16 -07:00
ql4_glbl.h [SCSI] qla4xxx: Print WARN_ONCE() if iSCSI function presence bit removed 2014-03-15 10:19:12 -07:00
ql4_init.c [SCSI] qla4xxx: ISP8xxx: Correct retry of adapter initialization 2014-03-15 10:19:11 -07:00
ql4_inline.h [SCSI] qla4xxx: Add support to set CHAP entries 2013-10-25 09:58:01 +01:00
ql4_iocb.c [SCSI] qla4xxx: Update Copyright header 2013-09-03 07:27:54 -07:00
ql4_isr.c [SCSI] libiscsi: Reduce locking contention in fast path 2014-03-15 10:19:18 -07:00
ql4_mbx.c [SCSI] qla4xxx: Update print statements in qla4xxx_mailbox_command() 2014-03-15 10:19:15 -07:00
ql4_nvram.c [SCSI] qla4xxx: Update Copyright header 2013-09-03 07:27:54 -07:00
ql4_nvram.h [SCSI] qla4xxx: Update Copyright header 2013-09-03 07:27:54 -07:00
ql4_nx.c [SCSI] qla4xxx: Reduce rom-lock contention during reset recovery. 2014-03-15 10:19:14 -07:00
ql4_nx.h [SCSI] qla4xxx: Update Copyright header 2013-09-03 07:27:54 -07:00
ql4_os.c [SCSI] qla4xxx: Fix sparse warnings 2014-03-15 10:19:16 -07:00
ql4_version.h [SCSI] qla4xxx: Update driver version to 5.04.00-k4 2014-03-15 10:19:16 -07:00