From: Shlomo Pongratz <[email protected]> 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() associated with iscsi sessions. Using these patches in an accelerated version of the iser initiator we were able to gain large improvements in IOPS rate in a situation where the burning bottle-neck was the session lock. changes from V0: - added two patches to handle the requing issue in libiscsi_tcp pointed out by Mike Christie The first patch is a restructuring patch for iscsi_tcp_r2t_rsp routine in order to avoid allocating r2t from r2tpool.queue and returning it back in case the parameters rhdr->data_length and or rhdr->data_offset prohibit the requeuing. The third patch (which can be squashed with the second one or maybe somehow can turn to be pre-patch to the main one) is a fix of a problem pointed out by Mike Christie, that is iscsi_tcp_r2t_rsp is called under backwards lock and it does insertion into a list for which the deletion is done under the forward lock. Shlomo Pongratz (3): SCSI/libiscsi_tcp: Restructure iscsi_tcp_r2t_rsp SCSI/libiscsi: Reduce locking contention in fast path SCSI/libisci_tcp: Add locking to protect r2t queues drivers/scsi/be2iscsi/be_main.c | 26 +++--- drivers/scsi/bnx2i/bnx2i_hwi.c | 46 +++++----- drivers/scsi/bnx2i/bnx2i_iscsi.c | 8 +- drivers/scsi/iscsi_tcp.c | 22 ++-- drivers/scsi/libiscsi.c | 198 ++++++++++++++++++++++---------------- drivers/scsi/libiscsi_tcp.c | 69 ++++++++------ drivers/scsi/qla4xxx/ql4_isr.c | 4 +- include/scsi/libiscsi.h | 9 +- include/scsi/libiscsi_tcp.h | 2 + 9 files changed, 213 insertions(+), 171 deletions(-) -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/open-iscsi. For more options, visit https://groups.google.com/groups/opt_out.
