Skip to contentSkip to conversation

USB performance bug since kernel 2.6.13 (CRITICAL???)

DISCUSSION Open Source 3 participants 3 messages Oct 12, 2006 – Oct 13, 2006

lore
Share & tools
lore
#0 lore raw

(Resending because [email protected] bounced right back to me. Sorry for the multiple messages!)

----- Forwarded Message ----
From: Open Source <[email protected]>
To: [email protected]; [email protected]
Sent: Thursday, October 12, 2006 12:21:56 PM
Subject: USB performance bug since kernel 2.6.13 (CRITICAL???)

Hi all,

I am writing regarding a performance issue that I recently observed after upgrading from kernel 2.6.12 to 2.6.17. I did some hunting around and have found that the issue first arises in 2.6.13.

I am using a device that submits URBs asynchronously using the libusb devio infrastructure. In version 2.6.12 I am able to submit and reap URBs for my particular application at a transaction rate of one per millisecond. A transaction consists of a single WRITE URB (< 512 bytes) followed by a single READ URB (1024 bytes). Once I upgrade to version 2.6.13, the transactional rate drops to one per 4 milliseconds!

The overall performance of a particular algorithm is increased from a total execution time of 75 seconds to over 160 seconds. The only difference between the two tests is the kernel. Microsoft Windows executes the algorithm in 70-75 seconds!

I am using a Fedora Core distribution with FC4 kernels for testing. Is there some new incantation that is required in my user-mode driver to get around a "feature" in recent kernels? Does anyone else know about this? I was not able to easily find discussion about this on the newsgroups. It appears that this problem has been around for a while, if it is indeed a problem.

I am not a subscriber to the linux-kernel mailing list but have cross-posted to it since this seems like a serious enough issue. Please continue to keep any responses on linux-usb-devel as well so I can see them in my email box.

Thank you,
Beleaguered Open Source Fan

#1 lore raw
Quoted 7 lines · Open Source

I am using a device that submits URBs asynchronously using the libusb devio infrastructure. In version 2.6.12 I am able to submit and reap URBs for my particular application at a transaction rate of one per millisecond. A transaction consists of a single WRITE URB (< 512 bytes) followed by a single READ URB (1024 bytes). Once I upgrade to version 2.6.13, the transactional rate drops to one per 4 milliseconds!

The kernel's internal tick rate was lowered from 1000Hz to 250Hz starting with 2.6.13. Rebuild with CONFIG_HZ=1000 and the performance should return to normal.

Lee

#2 lore raw
In reply to Open Source

[FYI, it would make things easier for the rest of us if you can convince your email client to wrap lines before 80 columns.]

Quoted 17 lines · Open Source

Hi all,
I am writing regarding a performance issue that I recently observed
after upgrading from kernel 2.6.12 to 2.6.17. I did some hunting around and have found that the issue first arises in 2.6.13.

I am using a device that submits URBs asynchronously using the libusb devio infrastructure. In version 2.6.12 I am able to submit and reap URBs for my particular application at a transaction rate of one per millisecond. A transaction consists of a single WRITE URB (< 512 bytes) followed by a single READ URB (1024 bytes). Once I upgrade to version 2.6.13, the transactional rate drops to one per 4 milliseconds!

The overall performance of a particular algorithm is increased from a total execution time of 75 seconds to over 160 seconds. The only difference between the two tests is the kernel. Microsoft Windows executes the algorithm in 70-75 seconds!

Quoted 6 lines

I am using a Fedora Core distribution with FC4 kernels for testing. Is there some new incantation that is required in my user-mode driver to get around a "feature" in recent kernels? Does anyone else know about this? I was not able to easily find discussion about this on the newsgroups. It appears that this problem has been around for a while, if it is indeed a problem.

I'll be interested to here if changing HZ back to 1000 makes any difference. As others have already stated, it shouldn't matter but maybe it does somehow.

Even if it does, there are things you might be able to do with HZ=250 to improve throughput. You could transfer more than 512/1024 bytes per URB. You could queue multiple URBs before waiting for the first one to complete. Provided you can keep the endpoint queues filled, you should be able to achieve the maximum throughput of the hardware.

Alan Stern