From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 1 13:31:54 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D9B9D16A41F; Thu, 1 Sep 2005 13:31:54 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41A3B43D45; Thu, 1 Sep 2005 13:31:54 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [10.1.1.7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.10/8.12.10) with ESMTP id j81DVnBS066805 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 1 Sep 2005 15:31:51 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id j81DVgqK015176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Sep 2005 15:31:42 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.11/8.12.11) with ESMTP id j81DVfhM004084; Thu, 1 Sep 2005 15:31:41 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id j81DVajl004083; Thu, 1 Sep 2005 15:31:36 +0200 (CEST) (envelope-from ticso) Date: Thu, 1 Sep 2005 15:31:36 +0200 From: Bernd Walter To: "Eygene A. Ryabinkin" Message-ID: <20050901133136.GL3267@cicely12.cicely.de> References: <200508302009.aa99975@nowhere.iedowse.com> <43160334.5000100@samsco.org> <43160943.6030400@samsco.org> <20050901084421.GA840@rea.mbslab.kiae.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050901084421.GA840@rea.mbslab.kiae.ru> X-Operating-System: FreeBSD cicely12.cicely.de 5.2-CURRENT alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-5.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 X-Spam-Report: * -3.3 ALL_TRUSTED Did not pass through any untrusted hosts * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on cicely12.cicely.de Cc: Scott Long , hackers@freebsd.org, Eugene Grosbein , Ian Dowse , freebsd-usb@freebsd.org Subject: Re: Low umass performance with USB 2.0 ports X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2005 13:31:55 -0000 On Thu, Sep 01, 2005 at 12:44:21PM +0400, Eygene A. Ryabinkin wrote: > > Actually, I just peeked inside the Linux EHCI code and it does a dummy > > read immediately after writing to the status register: > > > > /* clear (just) interrupts */ > > writel (status, &ehci->regs->status); > > readl (&ehci->regs->command); /* unblock posted write */ > > > > I wonder if that's the whole trick here. Would someone be willing to > > try the attached patch instead of the one that Ian posted? > Yes, that solved my problem. But the patch (for 5.x) uses different line > numbers: > ----- > --- /sys/dev/usb/ehci.c.orig Thu Sep 1 10:59:51 2005 > +++ /sys/dev/usb/ehci.c Thu Sep 1 10:48:59 2005 > @@ -580,6 +580,7 @@ > return (0); > > EOWRITE4(sc, EHCI_USBSTS, intrs); /* Acknowledge */ > + EOREAD4(sc, EHCI_USBCMD); /* Flush posted writes on PCI */ > sc->sc_bus.intr_context++; > sc->sc_bus.no_intrs++; > if (eintrs & EHCI_STS_IAA) { > ----- > Apart from this the patch works: the writing process still spends much time > in the wdrain state, but no stalls occurs. > > Just a remark: my USB 2.0 controller chip is made by NEC, not VIA. > > For a FAT curiosity: FAT 32 gives 700K/sec and FAT 16 -- 3 Mb/sec. FAT32 vs. FAT16 shouldn't be a difference, but the smaller cluster sizes that you usually get with FAT32 decrease the average transfer size. Basicly you can get around 500-1000 transactions per second over USB, unless interleaving multiple transactions is done. Since msdosfs does no aggregation you can end up with e.g. 512 Byte transactions. 700kB/s points to an FS with 2k cluster size. Currently I'm unshure if umass allows interleaving transactions, but your numbers makes me believe that it does not. -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de