All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>
To: linux-scsi <linux-scsi@vger.kernel.org>,
	device-mapper development <dm-devel@redhat.com>
Cc: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Mike Snitzer <snitzer@redhat.com>,
	Alasdair G Kergon <agk@redhat.com>
Subject: [PATCH] scsi: Fix dm-multipath starvation when scsi host is busy
Date: Tue, 22 May 2012 17:59:07 +0900	[thread overview]
Message-ID: <4FBB555B.5060608@ce.jp.nec.com> (raw)

When a scsi host is kept busy by a dm-mpath device, other dm-mpath device
on the same host could be starved. For example:
http://www.redhat.com/archives/dm-devel/2012-May/msg00123.html

It happens because dm-mpath delays request submission when the underlying
scsi host is busy even if sdev is not busy.

For case like this, it is better to send the request down and let scsi do
appropriate starvation control over the shared resource.

Though it might seem odd to change scsi's definition of a LLD being "busy",
it is reasonable because scsi_lld_busy (and blk_lld_busy) was introduced
to provide a hint for request-based stacking driver (i.e. dm-multipath)
and dm-multipath is the only user of this function.

Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Tested-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: <stable@vger.kernel.org>
---
 drivers/scsi/scsi_lib.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

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;

             reply	other threads:[~2012-05-22  8:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-22  8:59 Jun'ichi Nomura [this message]
2012-05-22  9:13 ` [PATCH] scsi: Fix dm-multipath starvation when scsi host is busy James Bottomley
2012-05-22  9:57   ` [PATCH v2] " Jun'ichi Nomura
2012-05-22 12:54     ` Mike Snitzer
2012-05-22 13:01       ` [dm-devel] " Hannes Reinecke

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=4FBB555B.5060608@ce.jp.nec.com \
    --to=j-nomura@ce.jp.nec.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=agk@redhat.com \
    --cc=bernd.schubert@itwm.fraunhofer.de \
    --cc=dm-devel@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=snitzer@redhat.com \
    /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.