From owner-freebsd-usb@FreeBSD.ORG Wed Mar 4 08:20:19 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 871E11065673 for ; Wed, 4 Mar 2009 08:20:19 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe12.tele2.se [212.247.155.97]) by mx1.freebsd.org (Postfix) with ESMTP id 195888FC19 for ; Wed, 4 Mar 2009 08:20:18 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=Ma5krZdYoiIA:10 a=-DXRHlJb_54A:10 a=F9Ddb8ZnJZvc46m2WQEPHQ==:17 a=V3CGy0ory5sdZRABxIoA:9 a=Nhq8M4o7NlFvPYYrYH4A:7 a=_-unnd2EU46UU0o1NBqpg1FTmT4A:4 a=50e4U0PicR4A:10 Received: from [85.19.79.136] (account mc467741@c2i.net HELO laptop.bitfrost.local) by mailfe12.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1032089937; Wed, 04 Mar 2009 09:20:17 +0100 From: Hans Petter Selasky To: Steve Calfee Date: Wed, 4 Mar 2009 09:22:46 +0100 User-Agent: KMail/1.9.7 References: <200903010045.44904.man@email.com.ua> <200903032243.31914.hselasky@c2i.net> <4a5ff6bc0903031415s16158407m386b8321a5082996@mail.gmail.com> In-Reply-To: <4a5ff6bc0903031415s16158407m386b8321a5082996@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903040922.48163.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: Low perfomance when read from usb flash drive X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2009 08:20:19 -0000 Hi Steve, On Tuesday 03 March 2009, Steve Calfee wrote: > > I think the reduced performance can be explained by a clamp on the > > interrupt rate around 1000 interrupts per second instead of 8000. Maybe > > someone has an explanation for this? > > > > The EHCI is being programmed to interrupt at 125us intervals, but there > > seems to be limits other places. > > > > It is possible to workaround this in the umass driver by doing the cmd + > > read in one operation. > > Hi Hans, > > I am looking at using FreeBSD in an embedded product. I have not > examined your ehci software, but I am aware of how Linux and other > OSes run the controller. > > Why are you taking an interrupt every uFrame SOF? If the transaction completes before 125us we take the interrupt before 125us. The problem is that the interrupt delay becomes critical to performance when the interrupt rate is close to the interrupt limitation. For example: Transferring 13Mbyte/sec at blocksize equal to 65536 bytes generates 600 interrupts. Hence the Mass Storage state machine has three steps the throughput is computed like (600/3)*65536 bytes. If we on the average have to wait 0.5ms for an interrupt we loose throughput. > async > doesn't care at all If you have to wait for a transaction before you can do the next one it matters. > - the only impact is possible xfer speed. Taking > really fast periodic (uFrame) interrupts guarantees no faster > transfers than just having the end of transfer interrupt. > --HPS