OSDN Git Service

scsi: iscsi: Try to avoid taking back_lock in xmit path
authorMike Christie <michael.christie@oracle.com>
Thu, 16 Jun 2022 22:45:56 +0000 (17:45 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 22 Jun 2022 01:19:23 +0000 (21:19 -0400)
commit6d626150d6d1c14f2f3d4f907fd0d4381f2c0d35
treeadf87d70efce5071a4cddb1d4435fbdc0f64d805
parente1c6a7ec14290a0e371b09300685638f9009f2ab
scsi: iscsi: Try to avoid taking back_lock in xmit path

We need the back lock when freeing a task, so we hold it when calling
__iscsi_put_task() from the completion path to make it easier and to avoid
having to retake it in that path. For iscsi_put_task() we just grabbed it
while also doing the decrement on the refcount but it's only really needed
if the refcount is zero and we free the task. This modifies
iscsi_put_task() to just take the lock when needed then has the xmit path
use it. Normally we will then not take the back lock from the xmit path. It
will only be rare cases where the network is so fast that we get a response
right after we send the header/data.

Link: https://lore.kernel.org/r/20220616224557.115234-9-michael.christie@oracle.com
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libiscsi.c