USB I/O draining my userspace (Ubuntu Natty 64b)

USB I/O draining my userspace (Ubuntu Natty 64b)

geoffrey mendelson geoffreymendelson at gmail.com
Wed Jun 15 17:04:30 IDT 2011


On Jun 15, 2011, at 4:19 PM, Ira Abramov wrote:
> Second, here's my problem: I have here a workstation running an Athlon
> 3700+, and part of my job is to occasionally write out an image file  
> to
> USB universal card reader, testing the product of my builds. The  
> writing
> takes forever (since I haven't discovered how to get dd to write out  
> the
> sparse image to the CF card sparsely). Also, untill I moved the card
> reader to one of the backpanel ports, the write would drag my entire
> environment to a halt at the same time - even the mouse pointer gets
> stuck at some point, until dd would finish. switching from front to  
> back
> panel and adding the oflag=dsync option solved the freַ¯ing of the
> userspace but not the horrible writing speeds.
>
> I have a feeling this is a major bug with the USBstorage driver or  
> some
> related module, but as this is old hardware running on the latest  
> kernel
> from Ubuntu, I am surprised. Anyone got a clue?


No. It has to do with how USB is implemented in hardware. Almost every  
motherboard I have seen only has 2 USB ports. Motherboards with 6 USB  
ports on the back, and connectors for more on the front of the case  
still have only 2 USB ports, but they have a hub built into the  
motherboard.

For example, on one system I have: lspci yields:

00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1  
Controller (rev 62)
00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1  
Controller (rev 62)
00:10.2 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 65)

The third USB controller is a PCI card. Now if you do a lsusb:

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

But I don't have any hubs. They are on the motherboard and the PCI card.

So if you plug the keyboard and mouse into the same port as the memory  
stick, you are doing two things.

The first is you are slowing the memory stick down to the speed of the  
keyboard and mouse, usually 12mbits per second.

The second is that you are blocking IO to the keyboard and mouse while  
the disk is busy.

Geoff.

-- 
Geoffrey S. Mendelson,  N3OWJ/4X1GM
Making your enemy reliant on software you support is the best revenge.













More information about the Linux-il mailing list