From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755261Ab0IAVX3 (ORCPT ); Wed, 1 Sep 2010 17:23:29 -0400 Received: from smtp127.sbc.mail.sp1.yahoo.com ([69.147.65.186]:44640 "HELO smtp127.sbc.mail.sp1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752716Ab0IAVX2 (ORCPT ); Wed, 1 Sep 2010 17:23:28 -0400 X-Yahoo-SMTP: fzDSGlOswBCWnIOrNw7KwwK1j9PqyNbe5PtLKiS4dDU.UNl_t6bdEZu9tTLW X-YMail-OSG: YXqs82EVM1nDvWNoTsGVYwtTvVOVyPYBNE1axRcu5rctJCf jPHKRCHMKJBJGzC812Q6cMyjsW7dEwl1QG697zzYNWhgEU5K1kd1hwhzhyVM w1IOfDM4_Q.0x5yyBan6L2JWn5v.e7FdQnUKlezo.X10UFNLR1WSxPWaiZPM 4CXxIhuktWGFRE8oIVPNj24yN61h1XYncDwuBgBqD8eql_5WvJXADCoehMe8 t9vbCTNy16XbW2rcOJIyRlckPwfal3Vvoa6ImQ9fOFwl6VrQDNY0eARpnCCM Nqszx.HJPfImET33xYrTtInYe68OHQ.XMzyXYaNGCCPcc8T7ZwhiZgnmHyZu .XfZZYak87TGR2SZ5aA-- X-Yahoo-Newman-Property: ymail-3 From: "Nicholas A. Bellinger" To: linux-scsi , linux-kernel Cc: Mike Christie , Vasu Dev , Matthew Wilcox , Christoph Hellwig , FUJITA Tomonori , Hannes Reinecke , James Bottomley , Nicholas Bellinger Subject: [PATCH] tcm_loop: Drop host_lock around struct scsi_cmnd->scsi_done() Date: Wed, 1 Sep 2010 14:23:25 -0700 Message-Id: <1283376205-8071-1-git-send-email-nab@linux-iscsi.org> X-Mailer: git-send-email 1.5.6.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicholas Bellinger Greetings all, This patch updates tcm_loop_queue_data_in() and tcm_loop_queue_status() to no longer hold struct Scsi_Host->host_lock while calling the struct scsi_cmnd->scsi_done() callback, in order queue the *sc off into the block softirq. This optimization is safely allowed for SCSI LLDs on modern v2.6 kernels, and is done by the majority of mainline SCSI LLDs. Thanks to Vasu Dev to the clarification on this item! Signed-off-by: Nicholas A. Bellinger --- drivers/target/tcm_loop/tcm_loop_fabric.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/drivers/target/tcm_loop/tcm_loop_fabric.c b/drivers/target/tcm_loop/tcm_loop_fabric.c index 588730a..ef23f07 100644 --- a/drivers/target/tcm_loop/tcm_loop_fabric.c +++ b/drivers/target/tcm_loop/tcm_loop_fabric.c @@ -379,7 +379,6 @@ int tcm_loop_queue_data_in(struct se_cmd *se_cmd) struct tcm_loop_cmd *tl_cmd = (struct tcm_loop_cmd *)se_cmd->se_fabric_cmd_ptr; struct scsi_cmnd *sc = tl_cmd->sc; - unsigned long flags; TL_CDB_DEBUG( "tcm_loop_queue_data_in() called for scsi_cmnd: %p" " cdb: 0x%02x\n", sc, sc->cmnd[0]); @@ -393,10 +392,7 @@ int tcm_loop_queue_data_in(struct se_cmd *se_cmd) } sc->result = host_byte(DID_OK) | SAM_STAT_GOOD; - - spin_lock_irqsave(sc->device->host->host_lock, flags); (*sc->scsi_done)(sc); - spin_unlock_irqrestore(sc->device->host->host_lock, flags); return 0; } @@ -405,7 +401,6 @@ int tcm_loop_queue_status(struct se_cmd *se_cmd) struct tcm_loop_cmd *tl_cmd = (struct tcm_loop_cmd *)se_cmd->se_fabric_cmd_ptr; struct scsi_cmnd *sc = tl_cmd->sc; - unsigned long flags; TL_CDB_DEBUG("tcm_loop_queue_status() called for scsi_cmnd: %p" " cdb: 0x%02x\n", sc, sc->cmnd[0]); @@ -421,9 +416,7 @@ int tcm_loop_queue_status(struct se_cmd *se_cmd) } else sc->result = host_byte(DID_OK) | se_cmd->scsi_status; - spin_lock_irqsave(sc->device->host->host_lock, flags); (*sc->scsi_done)(sc); - spin_unlock_irqrestore(sc->device->host->host_lock, flags); return 0; } -- 1.5.6.5