aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-09-20 18:10:46 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-10-02 13:36:43 -0400
commit97a1420d127ca1db2fd665707bf4e9501758147c (patch)
tree4d89c37ee1e55ec98b733bc968a0896c0a1985e8 /drivers
parentf6e67035a9edd79b8b202c159d5bec560bb9c358 (diff)
[SCSI] libsas: dynamic queue depth
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. Tested-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/libsas/sas_scsi_host.c39
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 8f3c4cc1bfe..ebd1417339e 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -761,8 +761,7 @@ int sas_target_alloc(struct scsi_target *starget)
761 return 0; 761 return 0;
762} 762}
763 763
764#define SAS_DEF_QD 32 764#define SAS_DEF_QD 256
765#define SAS_MAX_QD 64
766 765
767int sas_slave_configure(struct scsi_device *scsi_dev) 766int sas_slave_configure(struct scsi_device *scsi_dev)
768{ 767{
@@ -805,31 +804,29 @@ void sas_slave_destroy(struct scsi_device *scsi_dev)
805 dev->sata_dev.ap->link.device[0].class = ATA_DEV_NONE; 804 dev->sata_dev.ap->link.device[0].class = ATA_DEV_NONE;
806} 805}
807 806
808int sas_change_queue_depth(struct scsi_device *scsi_dev, int new_depth, 807int sas_change_queue_depth(struct scsi_device *sdev, int depth, int reason)
809 int reason)
810{ 808{
811 struct domain_device *dev = sdev_to_domain_dev(scsi_dev); 809 struct domain_device *dev = sdev_to_domain_dev(sdev);
812 int res = min(new_depth, SAS_MAX_QD);
813 810
814 if (dev_is_sata(dev)) 811 if (dev_is_sata(dev))
815 return __ata_change_queue_depth(dev->sata_dev.ap, scsi_dev, 812 return __ata_change_queue_depth(dev->sata_dev.ap, sdev, depth,
816 new_depth, reason); 813 reason);
817 814
818 if (reason != SCSI_QDEPTH_DEFAULT) 815 switch (reason) {
816 case SCSI_QDEPTH_DEFAULT:
817 case SCSI_QDEPTH_RAMP_UP:
818 if (!sdev->tagged_supported)
819 depth = 1;
820 scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth);
821 break;
822 case SCSI_QDEPTH_QFULL:
823 scsi_track_queue_full(sdev, depth);
824 break;
825 default:
819 return -EOPNOTSUPP; 826 return -EOPNOTSUPP;
820
821 if (scsi_dev->tagged_supported)
822 scsi_adjust_queue_depth(scsi_dev, scsi_get_tag_type(scsi_dev),
823 res);
824 else {
825 sas_printk("device %llx LUN %x queue depth changed to 1\n",
826 SAS_ADDR(dev->sas_addr),
827 scsi_dev->lun);
828 scsi_adjust_queue_depth(scsi_dev, 0, 1);
829 res = 1;
830 } 827 }
831 828
832 return res; 829 return depth;
833} 830}
834 831
835int sas_change_queue_type(struct scsi_device *scsi_dev, int qt) 832int sas_change_queue_type(struct scsi_device *scsi_dev, int qt)