On Sun, 4 Feb 2007, Oliver Neukum wrote: > Am Sonntag, 4. Februar 2007 17:07 schrieb Alan Stern: > > On Sat, 3 Feb 2007, Oliver Neukum wrote: > > > > > If you want simplicity, I'd suggest serialization. kmalloc for 4 bytes > > > is overkill. I think it is even faster if we block on the cases there's > > > a collision that go through kmalloc/kfree each time. > > > > On the other hand, the same routine calls usb_control_message() which does > > two kmallocs: one for the URB and one for the usb_ctrlrequest structure. > > Adding a third for the buffer wouldn't be so bad. > > That is not a good reason to make matters even worse. > > > Or we could pre-allocate everything; the ctrlrequest could even share the > > same cacheline as the I/O buffer. But most hubs are idle almost all the > > time, and it doesn't seem worthwhile to allocate permanently one URB per > > hub if it will hardly ever be used. > > You've changed that with autosuspend.
Yes, to some extent. It's still true that most of the time, hubs are idle. Well, the mutex patch will make a suitable addition to 2.6.20.1. We can consider separately whether it's worthwhile to preallocate a hub control URB. Alan Stern ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel