Under session level spinlock node->active_ios_lock in efct_scsi_io_alloc() there is a getting other spinlock of port level. That lead to competition between sessions and even between IOs in the same session due too much instructions under spinlock. This change reduces spinlock area just to active_ios list for which active_ios_lock is intended. Spinlock CPU usage is decreased from 18% down to 13% in efct driver. IOPS are increased from 220 kIOPS upto 264 kIOPS for one lun on my setup. Reviewed-by: Roman Bolshakov <r.bolshakov@xxxxxxxxx> Signed-off-by: Dmitry Bogdanov <d.bogdanov@xxxxxxxxx> --- drivers/scsi/elx/efct/efct_scsi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/elx/efct/efct_scsi.c b/drivers/scsi/elx/efct/efct_scsi.c index 40fb3a724c76..8535bb7eabd8 100644 --- a/drivers/scsi/elx/efct/efct_scsi.c +++ b/drivers/scsi/elx/efct/efct_scsi.c @@ -38,8 +38,6 @@ efct_scsi_io_alloc(struct efct_node *node) xport = efct->xport; - spin_lock_irqsave(&node->active_ios_lock, flags); - io = efct_io_pool_io_alloc(efct->xport->io_pool); if (!io) { efc_log_err(efct, "IO alloc Failed\n"); @@ -66,6 +64,7 @@ efct_scsi_io_alloc(struct efct_node *node) /* Add to node's active_ios list */ INIT_LIST_HEAD(&io->list_entry); + spin_lock_irqsave(&node->active_ios_lock, flags); list_add(&io->list_entry, &node->active_ios); spin_unlock_irqrestore(&node->active_ios_lock, flags); -- 2.25.1