Created attachment 165721 [details] config.gz For some reason direct writes to /dev/sd* file of an usb drive is very slow. On the over hand write to a filesystem on the same drive are much faster. How to reproduce: dd if=image.iso of=/dev/sdj bs=512k or cat image.iso > /dev/sdj Same also for partitions (sdj1) As bwm-ng reports average speeds to sdj are 200 - 300 KB/s with rare spikes up to 1.5 MB/s, so dd reports following: dd if=/dev/zero of=/dev/sdj1 bs=512k count=100 100+0 records in 100+0 records out 52428800 bytes (52 MB) copied, 118.525 s, 442 kB/s sudo dd if=/dev/zero of=/dev/sdj bs=512k count=100 100+0 records in 100+0 records out 52428800 bytes (52 MB) copied, 90.7202 s, 578 kB/s For the filesystem write the write speed is up to 4 MB/s and dd reports 2.6 MB/s: sudo dd if=/dev/zero of=/mnt/cdrom/zero oflag=sync bs=512k count=100 100+0 records in 100+0 records out 52428800 bytes (52 MB) copied, 20.2205 s, 2.6 MB/s dmes output for the usb drive: 6011.409625] usb 5-1: new high-speed USB device number 14 using ehci-pci [ 6011.526322] usb-storage 5-1:1.0: USB Mass Storage device detected [ 6011.526499] scsi host24: usb-storage 5-1:1.0 [ 6012.529497] scsi 24:0:0:0: Direct-Access Ut165 USB2FlashStorage 0.00 PQ: 0 ANSI: 2 [ 6012.529779] sd 24:0:0:0: Attached scsi generic sg9 type 0 [ 6012.530519] sd 24:0:0:0: [sdj] 7897088 512-byte logical blocks: (4.04 GB/3.76 GiB) [ 6012.531222] sd 24:0:0:0: [sdj] Write Protect is off [ 6012.531226] sd 24:0:0:0: [sdj] Mode Sense: 00 00 00 00 [ 6012.531957] sd 24:0:0:0: [sdj] Asking for cache data failed [ 6012.531960] sd 24:0:0:0: [sdj] Assuming drive cache: write through [ 6012.597750] sdj: sdj1 [ 6012.666217] sd 24:0:0:0: [sdj] Attached SCSI removable disk [ 6405.334070] sdj: unknown partition table [ 6469.679507] sdj: sdj1 [ 6469.683263] sdj: sdj1 uname -a: Linux bigpc 3.18.5 #108 SMP PREEMPT Fri Jan 30 12:47:34 CET 2015 x86_64 AMD FX(tm)-8120 Eight-Core Processor AuthenticAMD GNU/Linux Distro: gentoo Kernel vanilla, self compiled (config attached)
On other PC with Mate linux and 3.13.0-24-generic #47-Ubuntu SMP kernel got 6.1 MB/s on the same stick with dd. I am also pretty sure, what at some point i had also similar speeds with older kernel versions (but not sure, which one it was).
CONFIG_SCSI_MQ_DEFAULT cause the problem.