FS#12623 - [kernel26] Very slow writing speed while copying files from ext3 (local) to fat32 (usb key)

Attached to Project: Arch Linux
Opened by Niccolò Forlini (NitroRabber) - Tuesday, 30 December 2008, 22:45 GMT
Last edited by Roman Kyrylych (Romashka) - Saturday, 03 October 2009, 10:09 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version None
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:
While I'm copying some files or an heavy file (>1GB) on my USB pen drive, I see that the writing speed becomes very slow; it starts @ 30-35 MB/s, it copies the first 300 MB and then he begins to copy @ 10 MB/s; so, after some seconds, the speed becomes slowly and after some time it stops...


Steps to reproduce:
Copy a large file from the local hard drive (in this case ext3 fs) to an usb key (fat32).
This task depends upon

Closed by  Roman Kyrylych (Romashka)
Saturday, 03 October 2009, 10:09 GMT
Reason for closing:  Upstream
Additional comments about closing:  Not much point to keep this open.
Comment by Niccolò Forlini (NitroRabber) - Tuesday, 30 December 2008, 23:10 GMT
I forgot to specify my Arch:
Archlinux 2008.06 - x86_64
Testing repositories = active
Comment by Aaron Griffin (phrakture) - Wednesday, 31 December 2008, 04:56 GMT
Can you post an lsmod? Try adding ehci_hcd to your modules array so it gets loaded first. I suspect it's getting loaded second, making all USB devices work at non-2.0 speeds
Comment by Pierre Schmitz (Pierre) - Wednesday, 31 December 2008, 08:24 GMT
Are you sure you pen drive can handle more than 10MB/s or even 30MB7s? This looks like just caching to me.
Comment by Niccolò Forlini (NitroRabber) - Wednesday, 31 December 2008, 08:35 GMT
@Pierre Schmitz: Yes, maybe the start speed is too high, but it is strange that is continue to get slow, sometimes it copies at 900 kb/s, I tried on my computer desktop and it seems to copy faster on winXP (1.58GB in about 1.40 minutes, 16 MB/s writing speed).

@Aaron Griffin: The module you said is already loaded at boot:

nitr0@linuxbox360 ~ $ lsmod
Module Size Used by
ipv6 309952 10
rfcomm 43552 4
bridge 56736 0
stp 4740 1 bridge
llc 8224 2 bridge,stp
bnep 14720 2
l2cap 26112 16 rfcomm,bnep
bluetooth 60836 5 rfcomm,bnep,l2cap
coretemp 9088 0
reiserfs 243968 1
arc4 4096 2
ecb 5248 2
uvcvideo 62344 0
i2c_i801 12444 0
iwl3945 103288 0
nvidia 7809352 38
compat_ioctl32 11520 1 uvcvideo
videodev 37888 2 uvcvideo,compat_ioctl32
snd_pcsp 13052 1
mac80211 183088 1 iwl3945
sdhci_pci 10624 0
sdhci 19588 1 sdhci_pci
v4l1_compat 17284 2 uvcvideo,videodev
joydev 14208 0
ohci1394 34612 0
sg 31840 0
ricoh_mmc 6272 0
video 22164 5
i2c_core 26144 2 i2c_i801,nvidia
mmc_core 54624 1 sdhci
intel_agp 32880 0
ieee1394 91392 1 ohci1394
serio_raw 8196 0
iTCO_wdt 15184 0
iTCO_vendor_support 5636 1 iTCO_wdt
output 5248 1 video
cfg80211 36896 2 iwl3945,mac80211
uhci_hcd 27552 0
acer_wmi 18664 0
rfkill 13904 4 iwl3945,acer_wmi
led_class 6280 2 iwl3945,acer_wmi
wmi 8896 1 acer_wmi
thermal 20896 0
fan 7304 0
evdev 13984 15
button 9504 0
battery 14600 0
ac 7176 0
ehci_hcd 41356 0
usbcore 160304 4 uvcvideo,uhci_hcd,ehci_hcd
psmouse 57116 0
snd_seq_oss 35584 0
snd_seq_midi_event 9344 1 snd_seq_oss
snd_seq 58336 4 snd_seq_oss,snd_seq_midi_event
snd_seq_device 9364 2 snd_seq_oss,snd_seq
snd_hda_intel 529844 3
snd_hwdep 10632 1 snd_hda_intel
snd_pcm_oss 45568 0
snd_pcm 82952 3 snd_pcsp,snd_hda_intel,snd_pcm_oss
snd_timer 24720 2 snd_seq,snd_pcm
snd_page_alloc 11792 2 snd_hda_intel,snd_pcm
snd_mixer_oss 18944 1 snd_pcm_oss
snd 65096 18 snd_pcsp,snd_seq_oss,snd_seq,snd_seq_device,snd_hda_intel,snd_hwdep,snd_pcm_oss,snd_pcm,snd_timer,snd_mixer_oss
soundcore 9632 1 snd
tg3 133124 0
libphy 22656 1 tg3
fuse 59584 2
cpufreq_conservative 9736 0
cpufreq_ondemand 10512 1
cpufreq_powersave 3840 0
acpi_cpufreq 10896 1
freq_table 6272 2 cpufreq_ondemand,acpi_cpufreq
processor 46776 4 thermal,acpi_cpufreq
rtc_cmos 14040 0
rtc_core 21060 1 rtc_cmos
rtc_lib 4992 1 rtc_core
ext3 141200 3
jbd 57000 1 ext3
mbcache 10244 1 ext3
sr_mod 18884 0
cdrom 39080 1 sr_mod
sd_mod 29096 6
ata_generic 8196 0
pata_acpi 7296 0
ahci 36876 5
ata_piix 27652 0
libata 176480 4 ata_generic,pata_acpi,ahci,ata_piix
scsi_mod 119256 4 sg,sr_mod,sd_mod,libata


Thank you again.
Comment by Aaron Griffin (phrakture) - Wednesday, 31 December 2008, 16:54 GMT
Yes, I know it's loaded on boot. But udev doesn't guarantee ordering of the modules. I wanted to ensure ehci_hcd gets loaded FIRST.
Comment by Niccolò Forlini (NitroRabber) - Wednesday, 31 December 2008, 18:33 GMT
I tried to put ehci_hcd for first in the modules list in /etc/rc.conf; I did a reboot but nothing to do, it continues to start copying fast and decrease the writing speed until 4-5 MB/s...
Comment by Roman Kyrylych (Romashka) - Thursday, 28 May 2009, 18:04 GMT
what's the status of this?
Comment by Roman Kyrylych (Romashka) - Friday, 12 June 2009, 21:55 GMT
please try with kernel 2.6.30
Comment by Aaron Griffin (phrakture) - Friday, 12 June 2009, 22:01 GMT
Are you mounting the USB drive with option "sync" on? sync significantly slows writes.

Can you post the actual mount line and/or fstab entry?
Comment by snuo (snuo) - Wednesday, 01 July 2009, 10:56 GMT
This bug is still present in kernel 2.6.30. (sync is not on either)
Comment by Roman Kyrylych (Romashka) - Wednesday, 01 July 2009, 10:57 GMT
was this reported to bugzilla.kernel.org?
Comment by snuo (snuo) - Wednesday, 01 July 2009, 23:51 GMT
I don't see any related bugs on the kernel bugtracker.

Here's the relevant kernel.log entries of me unplugging, reconnecting and copying large files to my vfat32 flash drive on usb 2.0.
Jul 1 17:11:03 glowing-win kernel: usb 2-1: USB disconnect, address 7
Jul 1 17:11:27 glowing-win kernel: usb 1-4: new high speed USB device using ehci_hcd and address 9
Jul 1 17:11:27 glowing-win kernel: usb 1-4: configuration #1 chosen from 1 choice
Jul 1 17:11:27 glowing-win kernel: scsi13 : SCSI emulation for USB Mass Storage devices
Jul 1 17:11:27 glowing-win kernel: usb-storage: device found at 9
Jul 1 17:11:27 glowing-win kernel: usb-storage: waiting for device to settle before scanning
Jul 1 17:11:32 glowing-win kernel: scsi 13:0:0:0: Direct-Access Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 0 CCS
Jul 1 17:11:32 glowing-win kernel: sd 13:0:0:0: Attached scsi generic sg3 type 0
Jul 1 17:11:32 glowing-win kernel: usb-storage: device scan complete
Jul 1 17:11:34 glowing-win kernel: sd 13:0:0:0: [sdd] 15874048 512-byte hardware sectors: (8.12 GB/7.56 GiB)
Jul 1 17:11:34 glowing-win kernel: sd 13:0:0:0: [sdd] Write Protect is off
Jul 1 17:11:34 glowing-win kernel: sd 13:0:0:0: [sdd] Mode Sense: 23 00 00 00
Jul 1 17:11:34 glowing-win kernel: sd 13:0:0:0: [sdd] Assuming drive cache: write through
Jul 1 17:11:34 glowing-win kernel: sd 13:0:0:0: [sdd] Assuming drive cache: write through
Jul 1 17:11:34 glowing-win kernel: sdd: sdd1
Jul 1 17:11:34 glowing-win kernel: sd 13:0:0:0: [sdd] Attached SCSI removable disk
Jul 1 17:17:21 glowing-win kernel: usb 1-4: reset high speed USB device using ehci_hcd and address 9
Jul 1 17:18:09 glowing-win kernel: usb 1-4: reset high speed USB device using ehci_hcd and address 9
Jul 1 17:18:42 glowing-win kernel: usb 1-4: reset high speed USB device using ehci_hcd and address 9

Something about the resets is the issue but I'm not sure how to track it down.
Copying starts at ~32MB/s & begins dropping off to 0/Bs in the span of a few seconds after anywhere from 190MB-280MB have been copied.
After the operations sits at O/Bs for a while. Then it will resume transfers for a short period; (<15secs) never peaking above 3/MBs.
If the copy is canceled while the drive is in its stalled state then deletions of files on that drive will also stall for a similar period of time.
The same results happen regardless of whether the files are being moved/copied from vfat or ext3.

Relevant mountline: /dev/sdd1 on /media/disk type vfat (rw,nosuid,nodev,uhelper=hal,uid=1000,utf8,shortname=mixed)
Comment by snuo (snuo) - Thursday, 02 July 2009, 03:39 GMT
Other info:
Arch Linux 2009.03 x86_64
Testing repositories: off
Comment by Gerardo Exequiel Pozzi (djgera) - Wednesday, 22 July 2009, 23:17 GMT
  • Field changed: Category (System → Upstream Bugs)
Please report to upstream (LKML with CC-to usb maintainers or bugzilla), we can not do much here about this issue.
Comment by Alessandro Nakamuta (alessandro_ufms) - Monday, 10 August 2009, 09:04 GMT
I have the same issue here. After ~125MB copied, the velocity slows down. I have the copy from ext4 to fat32.

dmesg:
usb 3-4: new high speed USB device using ehci_hcd and address 9
usb 3-4: configuration #1 chosen from 1 choice
scsi8 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 9
usb-storage: waiting for device to settle before scanning
scsi 8:0:0:0: Direct-Access Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 0 CCS
sd 8:0:0:0: Attached scsi generic sg2 type 0
sd 8:0:0:0: [sdb] 8060928 512-byte hardware sectors: (4.12 GB/3.84 GiB)
sd 8:0:0:0: [sdb] Write Protect is off
sd 8:0:0:0: [sdb] Mode Sense: 23 00 00 00
sd 8:0:0:0: [sdb] Assuming drive cache: write through
usb-storage: device scan complete
sd 8:0:0:0: [sdb] Assuming drive cache: write through
sdb: sdb1
sd 8:0:0:0: [sdb] Attached SCSI removable disk

lsusb (verbose):
Bus 003 Device 009: ID 13fe:1d00 Kingston Technology Company Inc. DataTraveler 2.0 1GB/4GB Flash Drive / Patriot Xporter 4GB Flash Drive
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x13fe Kingston Technology Company Inc.
idProduct 0x1d00 DataTraveler 2.0 1GB/4GB Flash Drive / Patriot Xporter 4GB Flash Drive
bcdDevice 1.10
iManufacturer 1 Kingston
iProduct 2 DataTraveler 2.0
iSerial 3 5B7513AC6776
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 200mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk (Zip)
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)

Comment by Roman Kyrylych (Romashka) - Saturday, 03 October 2009, 10:07 GMT
We cannot help here, please report to kernel developers.

Loading...