From owner-freebsd-usb@FreeBSD.ORG Wed Mar 4 16:33:48 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 A1DD8106564A for ; Wed, 4 Mar 2009 16:33:48 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 3BFFA8FC14 for ; Wed, 4 Mar 2009 16:33:48 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 87BE1FF5B; Thu, 5 Mar 2009 05:33:47 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JPO-dGYMSfIu; Thu, 5 Mar 2009 05:33:43 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Thu, 5 Mar 2009 05:33:43 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 39DA01142F; Thu, 5 Mar 2009 05:33:43 +1300 (NZDT) Date: Wed, 4 Mar 2009 08:33:43 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090304163343.GD17847@citylink.fud.org.nz> References: <200903032243.31914.hselasky@c2i.net> <200903040922.48163.hselasky@c2i.net> <20090304.014655.1820405796.imp@bsdimp.com> <200903041001.37376.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200903041001.37376.hselasky@c2i.net> User-Agent: Mutt/1.5.17 (2007-11-01) 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 16:33:49 -0000 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. Andrew