usb/161793: poor EHCI usb2 i/o performance

Hans Petter Selasky hselasky at c2i.net
Wed Oct 19 06:00:40 UTC 2011


The following reply was made to PR usb/161793; it has been noted by GNATS.

From: Hans Petter Selasky <hselasky at c2i.net>
To: freebsd-usb at freebsd.org
Cc: Chargen <chargen at gmail.com>,
 freebsd-gnats-submit at freebsd.org
Subject: Re: usb/161793: poor EHCI usb2 i/o performance
Date: Wed, 19 Oct 2011 07:55:50 +0200

 Hello,
 
 When testing and formatting, it is important to set the block size to 65536 
 bytes to get the maximum performance. The default blocksize of "dd" is 512 
 bytes, and there is no read-ahead! Try again using:
 
 dd if=/dev/daX of=/dev/null bs=65536.
 
 Thank you,
 
 --HPS
 
 On Wednesday 19 October 2011 05:41:16 Chargen wrote:
 > >Number:         161793
 > >Category:       usb
 > >Synopsis:       poor EHCI usb2 i/o performance
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       low
 > >Responsible:    freebsd-usb
 > >State:          open
 > >Quarter:
 > >Keywords:
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Wed Oct 19 03:50:03 UTC 2011
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Chargen
 > >Release:        10.0-CURRENT
 > >Organization:
 > 
 > >Environment:
 > FreeBSD schwarzesonne 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Tue Oct 18
 > 21:40:49 CEST 2011    
 > chargen at schwarzesonne:/usr/src/sys/i386/compile/SCHWARZESONNE  i386
 > 
 > >Description:
 > I did some OHCI/EHCI usb1/2 subsystem performance checks on CURRENT with 1
 > older generation 1gb USB memory stick and a newer 2GB USB memory stick.
 > EHCI, usb2 UFS or MSDOSFS formatted gives about the same performance in
 > FreeBSD, ~3MB/s and about 8~10 MB/s under Windows operating systems using
 > the same hardware.
 > 
 > schwarzesonne# usbconfig dump_info | grep "480"
 > ugen2.1: <EHCI root HUB NEC> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps)
 > pwr=SAVE schwarzesonne# dmesg | grep "usbus2"
 > usbus2: EHCI version 1.0
 > usbus2: <NEC uPD 720100 USB 2.0 controller> on ehci0
 > usbus2: 480Mbps High Speed USB v2.0
 > ugen2.1: <NEC> at usbus2
 > uhub2: <NEC EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
 > ugen2.2: <Generic> at usbus2
 > umass0: <Generic Mass Storage, class 0/0, rev 2.00/1.41, addr 2> on usbus2
 > schwarzesonne# mount
 > /dev/da0p2 on / (ufs, local, noatime, journaled soft-updates)
 > devfs on /dev (devfs, local)
 > schwarzesonne# dmesg | grep "da1"
 > da1 at umass-sim0 bus 0 scbus4 target 0 lun 0
 > da1: <A60C0705 Flash Disk 8.07> Removable Direct Access SCSI-2 device
 > da1: 40.000MB/s transfers
 > da1: 999MB (2047998 512 byte sectors: 64H 32S/T 999C)
 > schwarzesonne# time dd if=/dev/zero of=/dev/da1 count=2
 > 2+0 records in
 > 2+0 records out
 > 1024 bytes transferred in 0.003543 secs (289029 bytes/sec)
 > 0.000u 0.002s 0:00.02 0.0%      0+0k 0+2io 0pf+0w
 > schwarzesonne# ls -alrt /dev/da1*
 > crw-r-----  1 root  operator  0x55 Oct 19 03:01 /dev/da1
 > crw-r-----  1 root  operator  0x62 Oct 19 03:01 /dev/da1s1
 > crw-r-----  1 root  operator  0x72 Oct 19 03:02 /dev/da1s1a
 > schwarzesonne# fdisk -vBI /dev/da1
 > ******* Working on device /dev/da1 *******
 > fdisk: invalid fdisk partition table found
 > parameters extracted from in-core disklabel are:
 > cylinders=999 heads=64 sectors/track=32 (2048 blks/cyl)
 > 
 > parameters to be used for BIOS calculations are:
 > cylinders=999 heads=64 sectors/track=32 (2048 blks/cyl)
 > 
 > Information from DOS bootblock is:
 > 1: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
 >     start 32, size 2045920 (998 Meg), flag 80 (active)
 >         beg: cyl 0/ head 1/ sector 1;
 >         end: cyl 998/ head 63/ sector 32
 > 2: <UNUSED>
 > 3: <UNUSED>
 > 4: <UNUSED>
 > fdisk: Class not found
 > schwarzesonne# bsdlabel -w da1s1
 > schwarzesonne# time newfs -O 1 /dev/da1s1a
 > /dev/da1s1a: 999.0MB (2045904 sectors) block size 32768, fragment size 4096
 >         using 4 cylinder groups of 249.75MB, 7992 blks, 16128 inodes.
 > super-block backups (for fsck -b #) at:
 >  64, 511552, 1023040, 1534528
 > 0.005u 0.015s 0:06.25 0.1%      128+15616k 6+260io 0pf+0w
 > schwarzesonne# mkdir /mnt/usb
 > schwarzesonne# mount -v /dev/da1s1a /mnt/usb/
 > /dev/da1s1a on /mnt (ufs, local, fsid 66279e4eff2fa382)
 > 
 > schwarzesonne# time dd if=/dev/zero bs=1m count=500 > /mnt/usb/500mb
 > 500+0 records in
 > 500+0 records out
 > 524288000 bytes transferred in 106.844333 secs (4907027 bytes/sec)
 > 0.007u 1.813s 1:46.85 1.6%      28+5603k 5+4006io 0pf+0w
 > 
 > : rebooted to flush caches and track read performance
 > 
 > schwarzesonne# reboot
 > schwarzesonne# mount /dev/da1s1a /mnt/usb
 > schwarzesonne# time cp /mnt/usb/500mb /root/.
 > 0.000u 2.665s 0:44.18 6.0%      21+5364k 4007+4000io 0pf+0w
 > 
 > :: EHCI, 2gb stick, usb2 performance, same procedure, rebooted and used
 > :: newfs
 > 
 > Oct 19 04:15:53 schwarzesonne kernel: da1 at umass-sim0 bus 0 scbus4 target
 > 0 lun 0 Oct 19 04:15:53 schwarzesonne kernel: da1: <CBM Flash Disk 5.00>
 > Removable Direct Access SCSI-2 device Oct 19 04:15:53 schwarzesonne
 > kernel: da1: 40.000MB/s transfers
 > Oct 19 04:15:53 schwarzesonne kernel: da1: 2024MB (4145664 512 byte
 > sectors: 255H 63S/T 258C) ugen2.2: <Flash Disk CBM> at usbus2, cfg=0
 > md=HOST spd=HIGH (480Mbps) pwr=ON
 > 
 > schwarzesonne# time newfs -O 1 /dev/da1s1a
 > /dev/da1s1a: 2023.8MB (4144688 sectors) block size 32768, fragment size
 > 4096 using 4 cylinder groups of 505.97MB, 16191 blks, 32512 inodes.
 > super-block backups (for fsck -b #) at:
 >  64, 1036288, 2072512, 3108736
 > 0.027u 0.009s 0:08.75 0.2%      64+7808k 6+516io 0pf+0w
 > schwarzesonne# time dd if=/dev/zero bs=1m count=500 > /mnt/usb/500mb
 > 500+0 records in
 > 500+0 records out
 > 524288000 bytes transferred in 173.849854 secs (3015752 bytes/sec)
 > 0.008u 1.812s 2:53.85 1.0%      23+4694k 4+4005io 0pf+0w
 > 
 > :: EHCI, 2gb stick, usb2 performance, msdosfs FAT formatted under WindowsXP
 > 
 > schwarzesonne# mount -t msdosfs -o -m=644,-M=755 /dev/da1s1 /mnt/usb
 > schwarzesonne# time dd if=/dev/zero bs=1m count=500 > /mnt/usb/500mb
 > 500+0 records in
 > 500+0 records out
 > 524288000 bytes transferred in 170.956245 secs (3066796 bytes/sec)
 > 0.008u 1.787s 2:50.95 1.0%      24+4862k 0+8001io 0pf+0w
 > 
 > :: OHCI, 2gb stick, performance
 > 
 > schwarzesonne# time dd if=/dev/zero bs=1m count=500 > /mnt/usb/500mb
 > 500+0 records in
 > 500+0 records out
 > 524288000 bytes transferred in 601.650968 secs (871416 bytes/sec)
 > 0.000u 1.723s 10:01.65 0.2%     22+4325k 4+4005io 0pf+0w
 > 
 > >How-To-Repeat:
 > >
 > >Fix:
 > >
 > >
 > >Release-Note:
 > >Audit-Trail:
 > 
 > >Unformatted:
 > _______________________________________________
 > freebsd-usb at freebsd.org mailing list
 > http://lists.freebsd.org/mailman/listinfo/freebsd-usb
 > To unsubscribe, send any mail to "freebsd-usb-unsubscribe at freebsd.org"


More information about the freebsd-usb mailing list