From patchwork Tue Sep 20 22:10:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 115636 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4BD23B6F95 for ; Wed, 21 Sep 2011 08:10:53 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752349Ab1ITWKs (ORCPT ); Tue, 20 Sep 2011 18:10:48 -0400 Received: from mga11.intel.com ([192.55.52.93]:12314 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752110Ab1ITWKr (ORCPT ); Tue, 20 Sep 2011 18:10:47 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 20 Sep 2011 15:10:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.68,413,1312182000"; d="scan'208";a="53758438" Received: from dwillia2-linux.jf.intel.com (HELO dwillia2-linux.localdomain) ([10.23.45.73]) by fmsmga001.fm.intel.com with ESMTP; 20 Sep 2011 15:10:46 -0700 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by dwillia2-linux.localdomain (Postfix) with ESMTP id B80525001BF; Tue, 20 Sep 2011 15:10:46 -0700 (PDT) Subject: [RFC PATCH 3/5] libsas: dynamic queue depth To: linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org From: Dan Williams Cc: Dave Jiang , Luben Tuikov , jgarzik@pobox.com, JBottomley@parallels.com, Jack Wang , Xiangliang Yu , Mark Salyzyn , Christoph Hellwig Date: Tue, 20 Sep 2011 15:10:46 -0700 Message-ID: <20110920221038.1094.7832.stgit@localhost6.localdomain6> In-Reply-To: <20110920220819.1094.12265.stgit@localhost6.localdomain6> References: <20110920220819.1094.12265.stgit@localhost6.localdomain6> User-Agent: StGit/0.15-7-g9bfb-dirty MIME-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org 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 Cc: Mark Salyzyn Cc: Xiangliang Yu Cc: Jack Wang Cc: Mark Salyzyn Cc: Luben Tuikov Tested-by: Dave Jiang Signed-off-by: Dan Williams --- drivers/scsi/libsas/sas_scsi_host.c | 39 ++++++++++++++++------------------- 1 files changed, 18 insertions(+), 21 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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)