All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
To: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: dm-devel@redhat.com,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: multipath_busy() stalls IO due to scsi_host_is_busy()
Date: Mon, 21 May 2012 17:42:57 +0200	[thread overview]
Message-ID: <4FBA6281.3040109@itwm.fraunhofer.de> (raw)
In-Reply-To: <4FB4C065.7070804@ce.jp.nec.com>

On 05/17/2012 11:09 AM, Jun'ichi Nomura wrote:
> Hi,
>
> On 05/16/12 21:28, Bernd Schubert wrote:
>> Looking through the call chain, I see the underlying problem seems to be in scsi_host_is_busy().
>>
>>> static inline int scsi_host_is_busy(struct Scsi_Host *shost)
>>> {
>>>      if ((shost->can_queue>  0&&  shost->host_busy>= shost->can_queue) ||
>>>          shost->host_blocked || shost->host_self_blocked)
>>>          return 1;
>>>
>>>      return 0;
>>> }
>
> multipath_busy() was introduced because, without that,
> a request would be prematurely sent down to SCSI,
> lose the chance of additional merges and result in
> bad performance.
>
> However, when it is target/host that is busy, I think dm should
> send the request down and let SCSI, which has better knowledge
> about the shared resource, do appropriate starvation control.
>
> Could you try the attached patch?
>
> ---
> Jun'ichi Nomura, NEC Corporation
>
> If sdev is not busy but starget and/or host is busy,
> it is better to accept a request from stacking driver.
> Otherwise, the stacking device could be starved by other device
> sharing the same target/host.
>
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index 5dfd749..0eb4602 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -1378,16 +1378,13 @@ static int scsi_lld_busy(struct request_queue *q)
>   {
>   	struct scsi_device *sdev = q->queuedata;
>   	struct Scsi_Host *shost;
> -	struct scsi_target *starget;
>
>   	if (!sdev)
>   		return 0;
>
>   	shost = sdev->host;
> -	starget = scsi_target(sdev);
>
> -	if (scsi_host_in_recovery(shost) || scsi_host_is_busy(shost) ||
> -	    scsi_target_is_busy(starget) || scsi_device_is_busy(sdev))
> +	if (scsi_host_in_recovery(shost) || scsi_device_is_busy(sdev))
>   		return 1;
>
>   	return 0;

Thanks, that works fine! I had something else in my mind for multipath, 
but if this can go into scsi we don't need the multipath patch anymore.
Are you going to officially submit it (missing signed-off)?

Thanks,
Bernd


  parent reply	other threads:[~2012-05-21 15:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-16 12:28 multipath_busy() stalls IO due to scsi_host_is_busy() Bernd Schubert
2012-05-16 14:06 ` James Bottomley
2012-05-16 14:29   ` Bernd Schubert
2012-05-16 15:27     ` [dm-devel] " Mike Christie
     [not found]       ` <4FB3C75F.3070903-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2012-05-16 15:54         ` Bernd Schubert
     [not found]           ` <4FB3CDC5.9040608-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
2012-05-16 17:03             ` David Dillow
2012-05-16 20:34               ` Bernd Schubert
2012-05-21 15:49               ` [PATCH] srp: convert SRP_RQ_SHIFT into a module parameter Bernd Schubert
     [not found]                 ` <4FBA6412.7040505-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
2012-05-21 19:35                   ` Bernd Schubert
2012-05-30  5:22                   ` David Dillow
     [not found]                     ` <1338355352.2361.24.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2012-05-30  5:24                       ` David Dillow
2012-05-17  9:09 ` multipath_busy() stalls IO due to scsi_host_is_busy() Jun'ichi Nomura
2012-05-17 13:46   ` Mike Snitzer
2012-05-21 15:42   ` Bernd Schubert [this message]
2012-05-22  4:31     ` Jun'ichi Nomura

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=4FBA6281.3040109@itwm.fraunhofer.de \
    --to=bernd.schubert@itwm.fraunhofer.de \
    --cc=dm-devel@redhat.com \
    --cc=j-nomura@ce.jp.nec.com \
    --cc=linux-scsi@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.