From: Dan Williams <dan.j.williams@intel.com>
To: linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org
Cc: Dave Jiang <dave.jiang@intel.com>,
Luben Tuikov <ltuikov@yahoo.com>,
jgarzik@pobox.com, JBottomley@parallels.com,
Jack Wang <jack_wang@usish.com>,
Xiangliang Yu <yuxiangl@marvell.com>,
Mark Salyzyn <msalyzyn@us.xyratex.com>,
Christoph Hellwig <hch@lst.de>
Subject: [RFC PATCH 3/5] libsas: dynamic queue depth
Date: Tue, 20 Sep 2011 15:10:46 -0700 [thread overview]
Message-ID: <20110920221038.1094.7832.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20110920220819.1094.12265.stgit@localhost6.localdomain6>
The queue-depth for libsas-attached devices initializes to 32 and can
only be increased manually via sysfs to a max of 64, while mpt2sas
attached devices initialize to 254 and dynamically float via the
midlayer ->change_queue_depth interface.
No performance regression was observed with this change on the isci
driver.
Cc: Christoph Hellwig <hch@lst.de>
Cc: Mark Salyzyn <msalyzyn@us.xyratex.com>
Cc: Xiangliang Yu <yuxiangl@marvell.com>
Cc: Jack Wang <jack_wang@usish.com>
Cc: Mark Salyzyn <msalyzyn@us.xyratex.com>
Cc: Luben Tuikov <ltuikov@yahoo.com>
Tested-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
drivers/scsi/libsas/sas_scsi_host.c | 39 ++++++++++++++++-------------------
1 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index 4c6923c..fe08ef0 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -784,8 +784,7 @@ int sas_target_alloc(struct scsi_target *starget)
return 0;
}
-#define SAS_DEF_QD 32
-#define SAS_MAX_QD 64
+#define SAS_DEF_QD 256
int sas_slave_configure(struct scsi_device *scsi_dev)
{
@@ -828,31 +827,29 @@ void sas_slave_destroy(struct scsi_device *scsi_dev)
dev->sata_dev.ap->link.device[0].class = ATA_DEV_NONE;
}
-int sas_change_queue_depth(struct scsi_device *scsi_dev, int new_depth,
- int reason)
+int sas_change_queue_depth(struct scsi_device *sdev, int depth, int reason)
{
- struct domain_device *dev = sdev_to_domain_dev(scsi_dev);
- int res = min(new_depth, SAS_MAX_QD);
+ struct domain_device *dev = sdev_to_domain_dev(sdev);
if (dev_is_sata(dev))
- return __ata_change_queue_depth(dev->sata_dev.ap, scsi_dev,
- new_depth, reason);
-
- if (reason != SCSI_QDEPTH_DEFAULT)
+ return __ata_change_queue_depth(dev->sata_dev.ap, sdev, depth,
+ reason);
+
+ switch (reason) {
+ case SCSI_QDEPTH_DEFAULT:
+ case SCSI_QDEPTH_RAMP_UP:
+ if (!sdev->tagged_supported)
+ depth = 1;
+ scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth);
+ break;
+ case SCSI_QDEPTH_QFULL:
+ scsi_track_queue_full(sdev, depth);
+ break;
+ default:
return -EOPNOTSUPP;
-
- if (scsi_dev->tagged_supported)
- scsi_adjust_queue_depth(scsi_dev, scsi_get_tag_type(scsi_dev),
- res);
- else {
- sas_printk("device %llx LUN %x queue depth changed to 1\n",
- SAS_ADDR(dev->sas_addr),
- scsi_dev->lun);
- scsi_adjust_queue_depth(scsi_dev, 0, 1);
- res = 1;
}
- return res;
+ return depth;
}
int sas_change_queue_type(struct scsi_device *scsi_dev, int qt)
next prev parent reply other threads:[~2011-09-20 22:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-20 22:10 [PATCH 0/5] libsas fixes discovered via isci-atapi enabling effort Dan Williams
2011-09-20 22:10 ` [PATCH 1/5] libsas: disable scanning lun > 0 on ata devices Dan Williams
2011-09-20 22:15 ` Christoph Hellwig
2011-09-21 12:28 ` Mark Salyzyn
2011-09-22 2:29 ` Jeff Garzik
2011-09-20 22:10 ` [PATCH 2/5] libsas: fix ->change_queue_{depth|type} for sata devices Dan Williams
2011-09-20 22:16 ` Christoph Hellwig
2011-09-21 12:27 ` Mark Salyzyn
2011-09-22 2:30 ` Jeff Garzik
2011-09-20 22:10 ` Dan Williams [this message]
2011-09-20 22:18 ` [RFC PATCH 3/5] libsas: dynamic queue depth Christoph Hellwig
2011-09-21 1:17 ` Jack Wang
2011-09-21 12:37 ` Mark Salyzyn
2011-09-22 1:38 ` Jack Wang
2011-09-20 22:10 ` [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure} Dan Williams
2011-09-22 2:26 ` Xiangliang Yu
2011-09-22 2:31 ` Jeff Garzik
2011-09-22 3:17 ` Williams, Dan J
2011-09-22 3:19 ` Xiangliang Yu
2011-09-20 22:11 ` [PATCH 5/5] pm8001: remove pm8001_slave_{alloc|configure} Dan Williams
2011-09-21 1:13 ` [PATCH 0/5] libsas fixes discovered via isci-atapi enabling effort Jack Wang
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=20110920221038.1094.7832.stgit@localhost6.localdomain6 \
--to=dan.j.williams@intel.com \
--cc=JBottomley@parallels.com \
--cc=dave.jiang@intel.com \
--cc=hch@lst.de \
--cc=jack_wang@usish.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=ltuikov@yahoo.com \
--cc=msalyzyn@us.xyratex.com \
--cc=yuxiangl@marvell.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox