On Thu, 22 Jul 2004, Oliver Neukum wrote: > If we want to avoid the memory allocation in block io path problem, > we have to preallocate. Besides, it is faster.
Yes, I agree. But we also have to balance the tradeoff between memory usage and speed. Reset is the only thing in the block I/O path outside of usb-storage and the s-g library, and it doesn't have to be fast. Here's another possibility. For each usb_device we include a pre-allocated URB, together with a usb_ctrlrequest and a 64-byte buffer. This URB could be used while holding the device lock, for things like get_descriptor, suspend, or reset. > An URB with its buffer preallocated is bound to a device, respectively > an endpoint, so it cannot complete without triggering the same irq the > completion handler is running in. Ah yes. Although I would prefer to make each URB & buffer bound to a HC/bus, not to a device or endpoint -- but that doesn't affect your point. This would allow us to replace an atomic_t with an unsigned long and use bit-operations rather than atomic_inc/atomic_dec. It would improve performance on the Sparc platform and wouldn't make much difference anywhere else. Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
