Skip to content

Commit e255a28

Browse files
author
Nicholas Bellinger
committed
iscsi-target: Only perform wait_for_tasks when performing shutdown
This patch changes transport_generic_free_cmd() to only wait_for_tasks when shutdown=true is passed to iscsit_free_cmd(). With the advent of >= v3.10 iscsi-target code using se_cmd->cmd_kref, the extra wait_for_tasks with shutdown=false is unnecessary, and may end up causing an extra context switch when releasing WRITEs. Cc: [email protected] # 3.10+ Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent db60df8 commit e255a28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/target/iscsi/iscsi_target_util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown)
736736
* Fallthrough
737737
*/
738738
case ISCSI_OP_SCSI_TMFUNC:
739-
rc = transport_generic_free_cmd(&cmd->se_cmd, 1);
739+
rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown);
740740
if (!rc && shutdown && se_cmd && se_cmd->se_sess) {
741741
__iscsit_free_cmd(cmd, true, shutdown);
742742
target_put_sess_cmd(se_cmd->se_sess, se_cmd);
@@ -752,7 +752,7 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown)
752752
se_cmd = &cmd->se_cmd;
753753
__iscsit_free_cmd(cmd, true, shutdown);
754754

755-
rc = transport_generic_free_cmd(&cmd->se_cmd, 1);
755+
rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown);
756756
if (!rc && shutdown && se_cmd->se_sess) {
757757
__iscsit_free_cmd(cmd, true, shutdown);
758758
target_put_sess_cmd(se_cmd->se_sess, se_cmd);

0 commit comments

Comments
 (0)