On Fri, 1 Dec 2006, Greg KH wrote:

> From: Greg Kroah-Hartman <[EMAIL PROTECTED]>
> 
> Might speed up some systems.  If nothing else, a bad driver should not
> take the whole USB subsystem down with it.
> 
> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
> ---
>  drivers/usb/core/Kconfig |   15 ++++++++
>  drivers/usb/core/hub.c   |   81 +++++++++++++++++++++++++++++++++------------
>  2 files changed, 74 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
> index 6e3b535..f8324d8 100644
> --- a/drivers/usb/core/Kconfig
> +++ b/drivers/usb/core/Kconfig
> @@ -72,6 +72,21 @@ config USB_SUSPEND
>  
>         If you are unsure about this, say N here.
>  
> +config USB_MULTITHREAD_PROBE
> +     bool "USB Multi-threaded probe (EXPERIMENTAL)"
> +     depends on USB && EXPERIMENTAL
> +     default n
> +     help
> +       Say Y here if you want the USB core to spawn a new thread for
> +       every USB device that is probed.  This can cause a small speedup
> +       in boot times on systems with a lot of different USB devices.
> +
> +       This option should be safe to enable, but if any odd probing
> +       problems are found, please disable it, or dynamically turn it
> +       off in the /sys/module/usbcore/parameters/multithread_probe
> +       file
> +
> +       When in doubt, say N.

You sent your original patch off to Linus instead of the variant I sent 
in, even though your patch violates the locking rules (see the kerneldoc 
for usb_new_device)!

By the way, have you observed any significant improvements in peformance 
from this patch?  I don't have any experience with systems having lots of 
USB devices attached.  For that matter, does speeding up khubd make any 
significant change to the overall boot time for a system?  One wouldn't 
think the other boot-up steps would have to wait for khubd...

This patch will help when many devices are plugged into the same hub (or
same root hub), but it won't probe multiple hubs in parallel.  It's not
clear which approach would be better in general, or whether some
combination of the two would be best.  It's not even clear whether the
overhead from spawning all these new threads is worth the savings from
doing I/O in parallel.

Also, I would expect the largest effects to show up at boot time.  At 
other times people tend to turn USB devices on or off (or plug and unplug 
them) one at a time, not many all at once.  But there still is all the 
overhead from creating new threads to handle these events.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to