Commit 2f424b9b authored by Quinn Tran's avatar Quinn Tran Committed by Nicholas Bellinger
Browse files

qla2xxx: Move atioq to a different lock to reduce lock contention



99% of the time the ATIOQ has SCSI command.  The other 1% of time
is something else.  Most of the time this interrupt does not need
to hold the hardware_lock.  We're moving the ATIO interrupt thread
to a different lock to reduce lock contention.

Signed-off-by: default avatarQuinn Tran <quinn.tran@qlogic.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent fb3269ba
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2936,6 +2936,7 @@ struct qlt_hw_data {
	uint32_t leak_exchg_thresh_hold;
	spinlock_t sess_lock;
	int rspq_vector_cpuid;
	spinlock_t atio_lock ____cacheline_aligned;
};

#define MAX_QFULL_CMDS_ALLOC	8192
+1 −0
Original line number Diff line number Diff line
@@ -778,5 +778,6 @@ extern int qla_get_exlogin_status(scsi_qla_host_t *, uint16_t *,
extern int qla_set_exlogin_mem_cfg(scsi_qla_host_t *vha, dma_addr_t phys_addr);
extern int qla_get_exchoffld_status(scsi_qla_host_t *, uint16_t *, uint16_t *);
extern int qla_set_exchoffld_mem_cfg(scsi_qla_host_t *, dma_addr_t);
extern void qlt_handle_abts_recv(struct scsi_qla_host *, response_t *);

#endif /* _QLA_GBL_H */
+4 −2
Original line number Diff line number Diff line
@@ -4919,7 +4919,7 @@ qla2x00_restart_isp(scsi_qla_host_t *vha)
	struct qla_hw_data *ha = vha->hw;
	struct req_que *req = ha->req_q_map[0];
	struct rsp_que *rsp = ha->rsp_q_map[0];
	unsigned long flags;
	unsigned long flags, flags2;

	/* If firmware needs to be loaded */
	if (qla2x00_isp_firmware(vha)) {
@@ -4948,8 +4948,10 @@ qla2x00_restart_isp(scsi_qla_host_t *vha)
			 * while we weren't online.
			 */
			spin_lock_irqsave(&ha->hardware_lock, flags);
			spin_lock_irqsave(&ha->tgt.atio_lock, flags2);
			if (qla_tgt_mode_enabled(vha))
				qlt_24xx_process_atio_queue(vha);
				qlt_24xx_process_atio_queue(vha, 1);
			spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2);
			spin_unlock_irqrestore(&ha->hardware_lock, flags);

			set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
+34 −10
Original line number Diff line number Diff line
@@ -2605,8 +2605,14 @@ process_err:
			qla24xx_els_ct_entry(vha, rsp->req, pkt, ELS_IOCB_TYPE);
			break;
		case ABTS_RECV_24XX:
			if (IS_QLA83XX(ha) || IS_QLA27XX(ha)) {
				/* ensure that the ATIO queue is empty */
			qlt_24xx_process_atio_queue(vha);
				qlt_handle_abts_recv(vha, (response_t *)pkt);
				break;
			} else {
				/* drop through */
				qlt_24xx_process_atio_queue(vha, 1);
			}
		case ABTS_RESP_24XX:
		case CTIO_TYPE7:
		case NOTIFY_ACK_TYPE:
@@ -2773,13 +2779,22 @@ qla24xx_intr_handler(int irq, void *dev_id)
		case INTR_RSP_QUE_UPDATE_83XX:
			qla24xx_process_response_queue(vha, rsp);
			break;
		case INTR_ATIO_QUE_UPDATE:
			qlt_24xx_process_atio_queue(vha);
		case INTR_ATIO_QUE_UPDATE:{
			unsigned long flags2;
			spin_lock_irqsave(&ha->tgt.atio_lock, flags2);
			qlt_24xx_process_atio_queue(vha, 1);
			spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2);
			break;
		case INTR_ATIO_RSP_QUE_UPDATE:
			qlt_24xx_process_atio_queue(vha);
		}
		case INTR_ATIO_RSP_QUE_UPDATE: {
			unsigned long flags2;
			spin_lock_irqsave(&ha->tgt.atio_lock, flags2);
			qlt_24xx_process_atio_queue(vha, 1);
			spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2);

			qla24xx_process_response_queue(vha, rsp);
			break;
		}
		default:
			ql_dbg(ql_dbg_async, vha, 0x504f,
			    "Unrecognized interrupt type (%d).\n", stat * 0xff);
@@ -2938,13 +2953,22 @@ qla24xx_msix_default(int irq, void *dev_id)
		case INTR_RSP_QUE_UPDATE_83XX:
			qla24xx_process_response_queue(vha, rsp);
			break;
		case INTR_ATIO_QUE_UPDATE:
			qlt_24xx_process_atio_queue(vha);
		case INTR_ATIO_QUE_UPDATE:{
			unsigned long flags2;
			spin_lock_irqsave(&ha->tgt.atio_lock, flags2);
			qlt_24xx_process_atio_queue(vha, 1);
			spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2);
			break;
		case INTR_ATIO_RSP_QUE_UPDATE:
			qlt_24xx_process_atio_queue(vha);
		}
		case INTR_ATIO_RSP_QUE_UPDATE: {
			unsigned long flags2;
			spin_lock_irqsave(&ha->tgt.atio_lock, flags2);
			qlt_24xx_process_atio_queue(vha, 1);
			spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2);

			qla24xx_process_response_queue(vha, rsp);
			break;
		}
		default:
			ql_dbg(ql_dbg_async, vha, 0x5051,
			    "Unrecognized interrupt type (%d).\n", stat & 0xff);
+2 −0
Original line number Diff line number Diff line
@@ -2337,6 +2337,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
	INIT_LIST_HEAD(&ha->tgt.q_full_list);
	spin_lock_init(&ha->tgt.q_full_lock);
	spin_lock_init(&ha->tgt.sess_lock);
	spin_lock_init(&ha->tgt.atio_lock);


	/* Clear our data area */
	ha->bars = bars;
Loading