Subject: Re: USB stack needs early review (Re: Someone should fix our
To: Dmitri Epshtein <dima@marvell.com>
From: Steve Woodford <scw@netbsd.org>
List: tech-kern
Date: 03/30/2007 10:25:50
On Thursday 29 March 2007 16:07, Dmitri Epshtein wrote:

> I am trying to understand why USB performance of mass storage device
> is bad.
> I mounted attached USB disk as /mnt/disk and run simple 'dd' command
> to read and write data to disk
> => dd if=/dev/zero of=/mnt/disk/new_file2 bs=131072 count=8196   //
> write
> => dd of=/dev/zero if=/mnt/disk/1G_file bs=131072 count=8196     //
> read

I can think of two reasons for this:

1. If your USB disk contains a FAT filesystem, be aware that NetBSD's
   FAT support does not perform read/write clustering. This results in
   lots of small USB packets, thus under-utilising the available
   bandwidth.
2. If you're running on ARM, the USB buffers are all cache-inhibited.
   I shouldn't need to tell you how much that will hurt performance. ;)

It looks like there are moves afoot to fix #2 by importing changes from 
FreeBSD, but I'm not aware of any plans to fix #1.

Cheers, Steve