public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: David Dillow <dillowda-1Heg1YXhbW8@public.gmane.org>
To: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
Cc: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: srp warning
Date: Thu, 13 Jan 2011 10:21:11 -0500	[thread overview]
Message-ID: <1294932071.3667.5.camel@lap75545.ornl.gov> (raw)
In-Reply-To: <AANLkTi=RP74hwT5nEr7XHyADPoE-7LKs8ECT_5QfS4pZ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, 2011-01-13 at 06:19 -0500, Bart Van Assche wrote:
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c
> b/drivers/infiniband/ulp/srp/ib_srp.c
> index 4b62105..3164c4d 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.c
> +++ b/drivers/infiniband/ulp/srp/ib_srp.c
> @@ -1132,16 +1132,12 @@ static int srp_queuecommand(struct Scsi_Host
> *shost, struct scsi_cmnd *scmnd)
> 
>  	spin_lock_irqsave(&target->lock, flags);
>  	iu = __srp_get_tx_iu(target, SRP_IU_CMD);
> -	if (iu) {
> -		req = list_first_entry(&target->free_reqs, struct srp_request,
> -				      list);
> -		list_del(&req->list);
> -	}
> +	if (unlikely(!iu))

Please drop the unlikely -- it isn't at all unlikely on the hardware and
loads I run.

> +		goto err_unlock;
> +	req = list_first_entry(&target->free_reqs, struct srp_request, list);
> +	list_del(&req->list);
>  	spin_unlock_irqrestore(&target->lock, flags);
> 
> -	if (!iu)
> -		goto err;
> -
>  	dev = target->srp_host->srp_dev->dev;
>  	ib_dma_sync_single_for_cpu(dev, iu->dma, srp_max_iu_len,
>  				   DMA_TO_DEVICE);
> @@ -1185,6 +1181,7 @@ err_iu:
> 
>  	spin_lock_irqsave(&target->lock, flags);
>  	list_add(&req->list, &target->free_reqs);
> +err_unlock:

Please add a line before the label.

>  	spin_unlock_irqrestore(&target->lock, flags);
> 
>  err:

If Roland would like to rebase his tree and substitute your patch for my
quickie, then I'm fine with that and you can have my Acked-by with the
above changes. If not, then make it relative to the uninit var change
and I'll be happy to put it in my pull request once the workqueue stuff
is sorted.

-- 
Dave Dillow
National Center for Computational Science
Oak Ridge National Laboratory
(865) 241-6602 office


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2011-01-13 15:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-12 17:43 srp warning Roland Dreier
     [not found] ` <adalj2q587i.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2011-01-12 17:52   ` David Dillow
     [not found]     ` <1294854748.15826.26.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2011-01-12 18:02       ` Roland Dreier
     [not found]         ` <ada8vyq57bq.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2011-01-12 19:42           ` David Dillow
     [not found]             ` <1294861341.15826.38.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2011-01-12 19:46               ` Roland Dreier
     [not found]                 ` <adaoc7l52hy.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2011-01-12 19:50                   ` Roland Dreier
     [not found]                     ` <adak4i952bk.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2011-01-12 21:07                       ` David Dillow
     [not found]                         ` <1294866460.15826.41.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2011-01-12 21:23                           ` Roland Dreier
2011-01-13  7:06                           ` Bart Van Assche
2011-01-13 11:19                           ` Bart Van Assche
     [not found]                             ` <AANLkTi=RP74hwT5nEr7XHyADPoE-7LKs8ECT_5QfS4pZ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-01-13 15:21                               ` David Dillow [this message]
     [not found]                                 ` <1294932071.3667.5.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2011-01-13 19:10                                   ` Bart Van Assche
     [not found]                                     ` <AANLkTinxZ=x9uQH-r1TN003HT1aKu_KjgF8-aXDkKzTm-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-01-13 19:22                                       ` David Dillow
2011-01-13 18:48                               ` Roland Dreier
2011-01-12 22:40               ` Jason Gunthorpe
     [not found]                 ` <20110112224016.GA2155-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2011-01-12 22:44                   ` David Dillow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1294932071.3667.5.camel@lap75545.ornl.gov \
    --to=dillowda-1heg1yxhbw8@public.gmane.org \
    --cc=bvanassche-HInyCGIudOg@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox