]> git.baikalelectronics.ru Git - kernel.git/commit
USB: ehci-hcd unlink speedups
authorDavid Brownell <dbrownell@users.sourceforge.net>
Wed, 4 Jun 2008 05:21:55 +0000 (22:21 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 21 Jul 2008 22:16:27 +0000 (15:16 -0700)
commit256982fe0e7fd84c81d4cdaee62d26371c677d4f
tree149c888f19921f356607c8d7a1c1001e148450ba
parent9e575b4e3de622b33610372be35f77e6fc2431ad
USB: ehci-hcd unlink speedups

This patch fixes some performance bugs observed with some workloads
when unlinking EHCI queue header (QH) descriptors from the async ring
(control/bulk schedule).

The mechanism intended to defer unlinking an empty QH (so there is no
penalty in common cases where it's quickly reused) was not working as
intended.  Sometimes the unlink was scheduled:

 - too quickly ... which can be a *strong* negative effect, since
   that QH becomes unavailable for immediate re-use;

 - too slowly ... wasting DMA cycles, usually a minor issue except
   for increased bus contention and power usage;

Plus there was an extreme case of "too slowly":  a logical error in the
IAA watchdog-timer conversion meant that sometimes the unlink never
got scheduled.

The fix replaces a simple counter with a timestamp derived from the
controller's 8 KHz microframe counter, and adjusts the timer usage
for some issues associated with HZ being less than 8K.

(Based on a patch originally by Alan Stern, and good troubleshooting
from  Leonid.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Leonid <leonidv11@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-q.c
drivers/usb/host/ehci.h