From owner-freebsd-current@FreeBSD.ORG Sat Nov 8 00:11:30 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0EF1106564A for ; Sat, 8 Nov 2008 00:11:30 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA08.emeryville.ca.mail.comcast.net (qmta08.emeryville.ca.mail.comcast.net [76.96.30.80]) by mx1.freebsd.org (Postfix) with ESMTP id A5EAE8FC08 for ; Sat, 8 Nov 2008 00:11:30 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA04.emeryville.ca.mail.comcast.net ([76.96.30.35]) by QMTA08.emeryville.ca.mail.comcast.net with comcast id cJ9k1a0460lTkoCA8QBWKU; Sat, 08 Nov 2008 00:11:30 +0000 Received: from koitsu.dyndns.org ([69.181.141.110]) by OMTA04.emeryville.ca.mail.comcast.net with comcast id cQBV1a0052P6wsM8QQBV5E; Sat, 08 Nov 2008 00:11:29 +0000 X-Authority-Analysis: v=1.0 c=1 a=uUfnya7hA3oA:10 a=xw72rLtdcjMA:10 a=QycZ5dHgAAAA:8 a=bKtheLr2vwmOw1xX-J8A:9 a=vDFqOzWuY3mf4Tr-TwRsaVfhdu8A:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id 43E795C34; Fri, 7 Nov 2008 16:11:28 -0800 (PST) Date: Fri, 7 Nov 2008 16:11:28 -0800 From: Jeremy Chadwick To: Hans Petter Selasky Message-ID: <20081108001128.GA1437@icarus.home.lan> References: <20081107082740.GA1334@icarus.home.lan> <200811071811.27181.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200811071811.27181.hselasky@c2i.net> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-current@freebsd.org Subject: Re: Kernel panic when copying data to umass device (USB4BSD) - problem found X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 00:11:30 -0000 On Fri, Nov 07, 2008 at 06:11:26PM +0100, Hans Petter Selasky wrote: > On Friday 07 November 2008, Jeremy Chadwick wrote: > > Not sure if this is caused by problems with USB4BSD or not, as I can > > reproduce it on RELENG_7 (but there, the kernel does not panic; it just > > "wedges" in a loop/thread somewhere; SSH sessions remain up, but > > commands running stop; hitting Ctrl-T shows them in all sorts of > > different states, but the states never change; hitting Ctrl-Alt-Esc does > > in fact drop me to db>). > > Hi Jeremy, > > I've reproduced the issue with some mods to the usb2_busdma.c on 32-bit > arcitecture and have made a fix for this problem. > > Try the following patch and re-test! Some mem-stick benchmarks would be > nice ... > > My private SVN also has this patch in addition to P4. Hans, To answer your question in your other mail: yes, this is on an amd64 machine with 4GB of RAM installed. With the patch to usb2_busdma applied, the problem is fixed! Thank you very, very much. As far as benchmarks: I'll keep it simple and try different block sizes. Numbers are compared against a Windows XP machine using the ATTO Benchmarking tool (which uses direct I/O read/writes, not filesystem I/O). Preface facts: - Testing done against SanDisk Cruzer Micro 8GB (SDCZ6-8192RB) - USB 2.0 bus used exclusively on both FreeBSD and Windows - Write caching disabled for USB drives on Windows XP - MD5 tests done against 7.1-BETA2-amd64-disc1.iso (573087744 bytes) - MD5 checksums matched source -- no corruption found on Windows or FreeBSD Software details: - ATTO Disk Benchmark v2.34 - ATTO configuration: Direct I/O, "Neither" type selected (vs. queued/overlapped I/O); data length size = 512MB - All FreeBSD tests done with HPS's busdma patches applied - dd read command: dd if=/dev/zero of=/dev/da0 bs= - dd write command: dd if=/dev/da0 of=/dev/null bs= - md5 command: time md5 7.1-BETA2-amd64-disc1.iso - FreeBSD filesystem: UFS1 (16KB blocks), using da0s1 directly - Windows filesystem: FAT32 (4KB blocks) Read Write --------- --------- Windows ATTO (4KB) 6.87MB/s 1.25MB/s Windows ATTO (8KB) 11.32MB/s 2.38MB/s Windows ATTO (16KB) 17.65MB/s 3.61MB/s Windows ATTO (32KB) 24.24MB/s 4.06MB/s Windows ATTO (64KB) 29.30MB/s 8.17MB/s Windows ATTO (128KB) 29.49MB/s 7.74MB/s Windows md5 2.38 sec n/a --------------------- USB4BSD dd (4KB) 6.72MB/s 1.55MB/s ** USB4BSD dd (8KB) 12.32MB/s 2.44MB/s USB4BSD dd (16KB) 18.45MB/s 3.59MB/s USB4BSD dd (32KB) 23.88MB/s 4.24MB/s USB4BSD dd (64KB) 29.32MB/s 8.90MB/s ** USB4BSD dd (128KB) 29.58MB/s 9.00MB/s ** FreeBSD md5 2.51 sec n/a ** Write speed gradually increased as transfer took place, topping out at the value shown; there was occasionally some variance in the transfer speed, so it wasn't a pure linear ramp-up. Points of interest: - FreeBSD and Windows have about equal read performance, but FreeBSD has slightly higher write performance - Mysterious "gradually increasing speed" with some block sizes - Jump in write performance with 64KB blocks (firmware optimisation?) - Slower write performance on Windows with 128KB blocks (I thought I was going crazy, but I tested this numerous times) To be brutally honest, I was expecting FreeBSD to perform badly during both read and write operations -- I was delightfully surprised to see the above. :-) I have a newer USB flash disk (SanDisk Cruzer Titanium 8GB) arriving early next week, so I can try that one out for comparison. SanDisk is known for tinkering with r/w optimisations in their firmwares. Cheers! -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |