From patchwork Thu Oct 29 20:21:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 55797 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp774904lbr; Thu, 29 Oct 2015 13:21:30 -0700 (PDT) X-Received: by 10.66.188.49 with SMTP id fx17mr3911454pac.95.1446150089784; Thu, 29 Oct 2015 13:21:29 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uh5si4874734pab.115.2015.10.29.13.21.29; Thu, 29 Oct 2015 13:21:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757837AbbJ2UVZ (ORCPT + 4 others); Thu, 29 Oct 2015 16:21:25 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:35181 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757826AbbJ2UVY (ORCPT ); Thu, 29 Oct 2015 16:21:24 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t9TKLLfK020897; Thu, 29 Oct 2015 15:21:21 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9TKLLxp029830; Thu, 29 Oct 2015 15:21:21 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Thu, 29 Oct 2015 15:21:21 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9TKLKXr013913; Thu, 29 Oct 2015 15:21:20 -0500 From: Felipe Balbi To: Matthew Dharm CC: Greg KH , Linux USB Mailing List , , Alan Stern , Felipe Balbi Subject: [PATCH] usb: storage: scsiglue: increase transfer size limit Date: Thu, 29 Oct 2015 15:21:19 -0500 Message-ID: <1446150079-17530-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Instead of using only 120K for transfer size, let's increase it to 1024K. This has a very noticeable impact on USB3 storage devices. The following measurements were done with v4.2 on the host side and latest linux-next available at the time (20151022). Following are results with default and modified max_sectors. Each number is the average of 100 measurements with each of the two settings. Pre 244.87 Post 322.10 That's a 24% increase in throughput by just allowing more sectors to transferred in a single request. Considering there are other SCSI devices using 2048 (and sometimes more) max_sectors, this shouldn't bring any surprises to anybody other than the extra memory used. Signed-off-by: Felipe Balbi --- drivers/usb/storage/scsiglue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" 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/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index dba51362d2e2..36450111e8b8 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -565,8 +565,8 @@ static const struct scsi_host_template usb_stor_host_template = { /* lots of sg segments can be handled */ .sg_tablesize = SCSI_MAX_SG_CHAIN_SEGMENTS, - /* limit the total size of a transfer to 120 KB */ - .max_sectors = 240, + /* limit the total size of a transfer to 1024 KB */ + .max_sectors = 2048 /* merge commands... this seems to help performance, but * periodically someone should test to see which setting is more