Am Sonntag, 1. Juli 2007 schrieb Alan Stern: > It's not entirely clear what you're trying to accomplish by doing this. > > First, notice that pre-allocation is useless with one-shot URBs, since > the resources would be allocated anyway as soon as the URB is
Yes, obviously. > submitted. You gain an advantage only by avoiding having the resources > deallocated when the URB completes, so that they can be reused when the > URB is resubmitted. (Or possibly when a different URB is submitted for > the same endpoint.) How will your changes affect deallocation? It happens when the URB is destroyed. > Notice also that the usb-storage doesn't reuse URBs for its large data > transfers (ub might work differently; I don't know). Those are all > done using one-shot URBs allocated by the scatter-gather library. Do > you intend to change how that works? That is a long term goal and would require some invasive changes in the storage driver. > Another thing worth noticing is that with reusable URBs, at allocation > time you might not know the transfer lengths you will need. Drivers > would have to guess at the maximum requirement and then live with that > guess. I doubt this is a common problem. Only rarely will a driver transfer more than PAGE_SIZE. > Finally, don't forget the advantages of avoiding preallocation and > keeping resources in a pool, available for multiple uses. What are these, beyond memory usage? My goals are: - speed up things for drivers that maintain pools of URBs: some serial drivers, cdc-acm, video drivers ... - reduce CPU usage in interrupt handlers and in general - remove some nasty ENOMEM error cases - guarantee the storage driver a fallback path without memory allocation Regards Oliver ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel