090c:1000 file transfer to/from USB 2.0 flash drive, via 3.0 port at best 50-60 Mb/s

Bug #1032342 reported by truant
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linux
New
Undecided
auto-linux-usb
linux (Ubuntu)
Incomplete
Medium
Unassigned

Bug Description

USB transfers to/from flash drives are very slow. Disk Utility reports the various drives I've tried are connected at 480Mb/s, but it's rare to see transfers faster than 50-60Mb/s at best, probably less as nautilus only reports average speed which is skewed by the first 300Mb being buffered.

Sometimes I get the first 300MB very fast followed by very slow and ending with a long pause while the write buffer writes out, sometimes they're just very slow from the start. Doesn't seem to matter if I'm transferring one big file or lots of little files. Seems faster with USB HDs. Flash drives I've tried so far are all working fine in other OSes on the same machine.

Also occurring with bleeding edge kernel (which I'm using because anything younger won't suspend properly on my machine), 3.5.0-999-generic #201207280406 SMP Sat Jul 28 08:07:29 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux.

The reason I'm reporting it here rather than at kernel.org is that I don't think it's a kernel bug, I think it's to do with Debian/Ubuntu's kernel patches. Because it doesn't happen in the live version of Fedora 17 I tried, but it does happen with Debian Wheezy. Windows 7 is also fast.

Laptop is a Toshiba L830-114. Attached is a usbmon log of dd if=/dev/zero of=/media/littlun/tmp oflag=direct bs=120K count=2K as recommended by Ming Lei here: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/834476

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: linux-image-3.2.0-27-generic 3.2.0-27.43
ProcVersionSignature: Ubuntu 3.2.0-27.43-generic 3.2.21
Uname: Linux 3.2.0-27-generic x86_64
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 2.0.1-0ubuntu11
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: PCH [HDA Intel PCH], device 0: CONEXANT Analog [CONEXANT Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: mat 1731 F.... pulseaudio
Card0.Amixer.info:
 Card hw:0 'PCH'/'HDA Intel PCH at 0xc0600000 irq 43'
   Mixer name : 'Intel PantherPoint HDMI'
   Components : 'HDA:14f1506e,1179fb90,00100003 HDA:80862806,1179fb90,00100000'
   Controls : 25
   Simple ctrls : 12
CurrentDmesg: [ 30.118970] wlan1: no IPv6 routers present
Date: Thu Aug 2 20:18:24 2012
HibernationDevice: RESUME=UUID=99547817-de1c-4c35-9bb3-845962582ed6
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
MachineType: TOSHIBA SATELLITE L830
ProcEnviron:
 LANGUAGE=en_GB:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-27-generic root=UUID=1c27fdd8-65a9-4b9c-8e8b-ba5e4660a55b ro quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-3.2.0-27-generic N/A
 linux-backports-modules-3.2.0-27-generic N/A
 linux-firmware 1.79
SourcePackage: linux
StagingDrivers: mei
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 06/11/2012
dmi.bios.vendor: Insyde Corp.
dmi.bios.version: 1.50
dmi.board.asset.tag: Type2 - Board Asset Tag
dmi.board.name: Type2 - Board Product Name1
dmi.board.vendor: Type2 - Board Vendor Name1
dmi.board.version: Type2 - Board Version
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: OEM Chassis Manufacturer
dmi.chassis.version: OEM Chassis Version
dmi.modalias: dmi:bvnInsydeCorp.:bvr1.50:bd06/11/2012:svnTOSHIBA:pnSATELLITEL830:pvrPSK7YE-00J004EN:rvnType2-BoardVendorName1:rnType2-BoardProductName1:rvrType2-BoardVersion:cvnOEMChassisManufacturer:ct10:cvrOEMChassisVersion:
dmi.product.name: SATELLITE L830
dmi.product.version: PSK7YE-00J004EN
dmi.sys.vendor: TOSHIBA

Revision history for this message
truant (launchpad-ninj4) wrote :
Brad Figg (brad-figg)
Changed in linux (Ubuntu):
status: New → Confirmed
tags: added: quantal
Revision history for this message
penalvch (penalvch) wrote :

truant, thank you for reporting this and helping make Ubuntu better.
+ Just to be clear, regarding your Bug Description:
>"Also occurring with bleeding edge kernel (which I'm using because anything younger won't suspend properly on my machine), 3.5.0-999-generic..."

Where specifically did you install that kernel from?

+ Did this issue not occur in prior Ubuntu releases?

+ Could you please plug in one of the USB flash drives that demonstrate the problem, unplug all other devices, excute the following at a terminal, and post the results to this report:
lsusb

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
importance: Undecided → Medium
tags: added: needs-upstream-testing
Revision history for this message
truant (launchpad-ninj4) wrote :

I installed that kernel from here: http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/ it's an Ubuntu build.

This machine has only ever had Precise on it. For the last few years I've been using mostly Debian, but I ended up with Ubuntu because Debian (for some reason) couldn't control the fan. So I couldn't say whether other 'buntus on this hardware had the same problem.

I have always had trouble with USB being slow in the past, since the first release, but I generally assumed it was either the device or my controller. This Toshiba machine is the first Ubuntu/Win7 dual-boot I've had for a while and it was only in Windows that I noticed how slow Ubuntu was.

lsusb attached. Not sure why it's reporting as a 64MB drive, it's a PNY 4GB. But that's just one from the pile which all exhibit the same issue.

Revision history for this message
penalvch (penalvch) wrote : Re: 090c:1000 file transfers to/from USB flash drives very slow

Truant, thank you for providing that information. Could you please test for this problem in a Lucid environment using http://cdimage.ubuntu.com/lucid/daily-live/current/ ?

summary: - file transfers to/from USB flash drives very slow
+ 090c:1000 file transfers to/from USB flash drives very slow
Revision history for this message
truant (launchpad-ninj4) wrote :

Sure thing. Transfers still very slow in Lucid, although interestingly Nautilus reports it slightly differently - I get a really fast progress bar all the way, which stalls at 100% for the remaining time.. I had a stopwatch going, so I know the transfers were taking the same time as in Precise.

penalvch (penalvch)
tags: added: lucid
tags: added: kernel-bug-exists-upstream
removed: needs-upstream-testing
penalvch (penalvch)
summary: - 090c:1000 file transfers to/from USB flash drives very slow
+ 090c:1000 file transfers to/from USB 2.0 flash drives very slow
Revision history for this message
truant (launchpad-ninj4) wrote : Re: 090c:1000 file transfers to/from USB 2.0 flash drives very slow

possibly worth mentioning that the ports on this machine are all USB3.0, but the drives I've tried with are 2.0. I don't have any USB3.0 devices to test with.

Revision history for this message
penalvch (penalvch) wrote :

truant, marking Triaged as mainline tested, regression ruled out due to test from Lucid, USB trace provided, and problem does not occur in Fedora 17 Live CD, or Windows 7 dual boot.

The next step would be to contact the upstream USB maintainer via E-Mail, as they have made it clear they do not want USB bugs to be file on bugzilla.kernel.org. Could you please do this following https://wiki.ubuntu.com/Bugs/Upstream/kernel#KernelTeam.2BAC8-KernelTeamBugPolicies.Overview_on_Reporting_Bugs_Upstream ?

Changed in linux (Ubuntu):
status: Incomplete → Triaged
tags: added: kernel-bug-exists-upstream-3.5.0-999-generic-201207280406
summary: - 090c:1000 file transfers to/from USB 2.0 flash drives very slow
+ 090c:1000 file transfers to/from USB 2.0 flash drives at best 50-60 Mb/s
penalvch (penalvch)
summary: - 090c:1000 file transfers to/from USB 2.0 flash drives at best 50-60 Mb/s
+ 090c:1000 file transfer to/from USB 3.0 flash drive, via 2.0 port at
+ best 50-60 Mb/s
Revision history for this message
truant (launchpad-ninj4) wrote :

I certainly can do that. Thanks very much for your help so far.

summary: - 090c:1000 file transfer to/from USB 3.0 flash drive, via 2.0 port at
+ 090c:1000 file transfer to/from USB 2.0 flash drive, via 3.0 port at
best 50-60 Mb/s
Revision history for this message
Alan Stern (stern) wrote :

On Fri, 3 Aug 2012, mat brown wrote:

> The following is formatted in line with the info here:
> https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Kernel.org_Format
> and sent as advised at the end of this bug report here:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1032342
>
> Thanks in advance for your time, I very much hope I've minimised any
> wastage of that precious resource.

> Summary:
>
> 090c:1000 file transfer to/from USB 2.0 flash drive, via 3.0 port at
> best 50-60 Mb/s

> The reason I'm reporting it here rather than at kernel.org is that I
> don't think it's a kernel bug, I think it's to do with Debian/Ubuntu's
> kernel patches. Because it doesn't happen in the live version of
> Fedora 17 I tried, but it does happen with Debian Wheezy. Windows 7 is
> also fast.

What mount options are used for the flash drive? In particular, does
Ubuntu use the "sync" option?

Also, do any error messages show up in the system log during the slow
data transfers?

Alan Stern

penalvch (penalvch)
no longer affects: linux
Revision history for this message
Alan Stern (stern) wrote :

On Fri, 3 Aug 2012, mat brown wrote:

> mount reports the following:
>
> /dev/sdb1 on /media/littlun type vfat
> (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)
>
> Nothing shows up in syslog during transfers.
>
> One thing I hadn't tried until a moment ago was an fs other than
> fat32. Same issue occurs with ext4.

In that case you should use usbmon to record what happens during one of
the slow transfers. Instructions are in the kernel source file
Documentation/usb/usbmon.txt.

It doesn't have to be a big transfer; 10 MB will probably be enough to
point out the problem.

Alan Stern

Revision history for this message
Alan Stern (stern) wrote :

On Fri, 3 Aug 2012, mat brown wrote:

> Already done as requested by the Ubuntu devs. File is here:
> https://launchpadlibrarian.net/111697628/usbmon.out
>
> The transfer which created that file was generated using dd
> if=/dev/zero of=/media/littlun/tmp oflag=direct bs=120K count=2K

It's odd. The usbmon log shows things working pretty well most of the
time, with transfer speeds around 200 Mb/s, but every now and then a
single 120-KB transfer takes more than half a second!

I have no idea why. We can rule out hardware problems because it
doesn't happen under Fedora. Maybe interrupt delivery gets delayed
somehow under Ubuntu, or maybe something is different in the xhci-hcd
driver. Can you compare the driver source files?

To do more serious testing will require you to build your own kernel,
or at least, your own version of the driver.

Alan Stern

Revision history for this message
Alan Stern (stern) wrote :

On Fri, 3 Aug 2012, mat brown wrote:

> I'm getting a bit out of my depth now, but I'm pretty sure the
> xhci_hcd module is compiled into the Ubuntu kernels. If I were to dig
> around in Ubuntu's kernel sources looking for xhci_hcd.* files to diff
> against Fedora's, would that be a useful thing for me to do?

I don't know. If there's no difference then it wouldn't be very
useful. :-)

> It's been a few years but I have compiled my own kernels in the past,
> but I can definitely have a go at that if you think it would be
> beneficial.

There aren't too many alternatives at this point. One possibility is
to try booting a Fedora kernel on an Ubuntu system. I don't know if
that can work, but if it does then it would indicate whether the
problem is in the kernel or in the userspace environment.

> Thanks for your help so far Alan, it's very much appreciated. I know
> wizards of your level are busy people.

You're welcome. (And I don't feel like a wizard; I feel like an
ordinary busy person...)

Alan Stern

Revision history for this message
penalvch (penalvch) wrote :

truant, please take care that when you do testing and provide it to the upstream mailing list, they only want to see results from the mainline you mentioned you already tested in your comment https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1032342/comments/3 .

As well, Ubuntu kernel testing inquiries should only be submitted to this Launchpad report alone, with no E-Mail or CC to <email address hidden> , as Ubuntu kernels are the Ubuntu Community's responsibility, not upstreams.

Thank you for your understanding.

Revision history for this message
penalvch (penalvch) wrote :

truant, as per http://www.toshiba.co.uk/innovation/download_bios.jsp?service=UK an update is available for your BIOS (6.30). If you update to this following https://help.ubuntu.com/community/BiosUpdate , does it change anything?

If not, could you please both specify what happened, and provide the output of the following terminal command:
sudo dmidecode -s bios-version && sudo dmidecode -s bios-release-date

Please note your current BIOS is already in the Bug Description, so posting this on the old BIOS would not be helpful.

For more on BIOS updates and linux, please see https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette .

Thank you for your understanding.

tags: added: bios-outdated-6.30
Changed in linux (Ubuntu):
status: Triaged → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

  • auto-linux-usb Edit

Bug watches keep track of this bug in other bug trackers.