summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/elx
diff options
context:
space:
mode:
authorDmitry Bogdanov <d.bogdanov@yadro.com>2021-09-14 13:55:39 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2021-09-22 00:04:56 -0400
commite76b7c5e25a1fa818bb3e727873a899cc89f5196 (patch)
tree4b5faf223d55af02c8bc96c973dee6bccdb2763e /drivers/scsi/elx
parentee3dce9f38426776b48406441d0dc39c74940818 (diff)
downloadlinux-e76b7c5e25a1fa818bb3e727873a899cc89f5196.tar.bz2
scsi: efct: Decrease area under spinlock
Under the session level spinlock node->active_ios_lock in efct_scsi_io_alloc() we are taking another spinlock for the port. This leads to contention between sessions and even between I/Os in the same session. Reduce the locked region to active_ios list for which active_ios_lock is intended. Spinlock CPU usage decreases from 18% down to 13%. IOPS are increased from 220 kIOPS to 264 kIOPS for one LUN. Link: https://lore.kernel.org/r/20210914105539.6942-4-d.bogdanov@yadro.com Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com> Reviewed-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/elx')
-rw-r--r--drivers/scsi/elx/efct/efct_scsi.c3
1 files changed, 1 insertions, 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);