From owner-freebsd-usb@FreeBSD.ORG Wed Mar 4 18:08:31 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 C7F4B1065670; Wed, 4 Mar 2009 18:08:31 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.swip.net [212.247.154.161]) by mx1.freebsd.org (Postfix) with ESMTP id 07AEA8FC08; Wed, 4 Mar 2009 18:08:30 +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=MXw7gxVQKqGXY79tIT8aFQ==:17 a=8kQB0OdkAAAA:8 a=YQoiwSLTK2HH0V1lXNcA:9 a=kzxRqTxKut2zIV_Q4WMA:7 a=0L1CQnPMqGXVUZpmdSazwfcwRqAA:4 a=LY0hPdMaydYA:10 a=9aOQ2cSd83gA:10 Received: from [62.113.132.61] (account mc467741@c2i.net HELO laptop) by mailfe06.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1205660811; Wed, 04 Mar 2009 19:08:29 +0100 From: Hans Petter Selasky To: Andrew Thompson Date: Wed, 4 Mar 2009 19:10:57 +0100 User-Agent: KMail/1.9.7 References: <200903032243.31914.hselasky@c2i.net> <200903041001.37376.hselasky@c2i.net> <20090304163343.GD17847@citylink.fud.org.nz> In-Reply-To: <20090304163343.GD17847@citylink.fud.org.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903041910.58446.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 18:08:32 -0000 On Wednesday 04 March 2009, Andrew Thompson wrote: > On Wed, Mar 04, 2009 at 10:01:36AM +0100, Hans Petter Selasky wrote: > > On Wednesday 04 March 2009, M. Warner Losh wrote: > > > In message: <200903040922.48163.hselasky@c2i.net> > > > > > > : > 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. > > > > > > Shouldn't you be using filters and such to make this less relevant? A > > > filter runs on the order of 5us after the interrupt on fast machines, > > > and 20us on slower (400MHz) ones. You can feed the pipeline better, > > > and handle higher interrupt rates... > > > > Yes, that's one possibility. It looks like there is some timing slightly > > out of sync. I have an AMD box with the same symptoms. I will try to > > figure out what is causing it. > > If you do change to filters then this is much easier with taskqueues as > it has a fast variant, otherwise you would need an intermediate step in > order to signal the existing usb threading scheme. The taskqueue > changeover will be happening soonish anyway. I am not going to do anything with filters. I'm going to try some other things. --HPS