From: Asias He Subject: Re: [PATCH 8/9] vhost/scsi: Drop unnecessary wait_for_tasks=true usage with transport_generic_free_cmd Date: Thu, 27 Jun 2013 09:59:12 +0800 Message-ID: <20130627015912.GA4133@hj.localdomain> References: <1370640864-15568-1-git-send-email-nab@linux-iscsi.org> <1370640864-15568-9-git-send-email-nab@linux-iscsi.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1370640864-15568-9-git-send-email-nab@linux-iscsi.org> Sender: target-devel-owner@vger.kernel.org To: "Nicholas A. Bellinger" Cc: target-devel , linux-scsi , Christoph Hellwig , Roland Dreier , Kent Overstreet , "Michael S. Tsirkin" , Or Gerlitz , Moussa Ba List-Id: linux-scsi@vger.kernel.org On Fri, Jun 07, 2013 at 09:34:23PM +0000, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > This patch changes vhost_scsi_free_cmd() to call transport_generic_free_cmd() > with wait_for_tasks=false in order to avoid the extra se_cmd->t_state_lock > access for the wait_for_tasks=true case. > > This is unnecessary because vhost_scsi_free_cmd() is only ever called by > vhost_scsi_complete_cmd_work() after TCM completion handoff, and by > vhost_scsi_handle_vq() exception code before TCM submission handoff, so > there is never a case where se_cmd is still active from TCM's perspective > when transport_generic_free_cmd() is called. > > Cc: Christoph Hellwig > Cc: Roland Dreier > Cc: Kent Overstreet > Cc: Asias He > Cc: Michael S. Tsirkin > Cc: Or Gerlitz > Cc: Moussa Ba > Signed-off-by: Nicholas Bellinger Acked-by: Asias He > --- > drivers/vhost/scsi.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c > index 7014202..aacf71e 100644 > --- a/drivers/vhost/scsi.c > +++ b/drivers/vhost/scsi.c > @@ -557,7 +557,7 @@ static void vhost_scsi_free_cmd(struct tcm_vhost_cmd *tv_cmd) > struct se_cmd *se_cmd = &tv_cmd->tvc_se_cmd; > > /* TODO locking against target/backend threads? */ > - transport_generic_free_cmd(se_cmd, 1); > + transport_generic_free_cmd(se_cmd, 0); > > if (tv_cmd->tvc_sgl_count) { > u32 i; > -- > 1.7.2.5 > -- Asias