On Thursday 28 September 2006 8:05 am, Christopher "Monty" Montgomery wrote: > On 9/27/06, David Brownell <[EMAIL PROTECTED]> wrote: > > > B) Break struct ehci_qh into two parts, one allcated with > > > dma_pool_alloc() and one allocated with kmalloc(), where the fields > > > accessed by the hardware is put into the former, and the driver > > > private data (which includes the kref) in the latter. Safe and no > > > major performance hit (just one level of indirection added in some > > > places, and using cache-enabled memory for the internal data might > > > actually improve performance), but the change touches a rather > > > large amount of lines (patch attached). > > > > I don't much like this one, other than the potential improvement in > > cache behavior. While it's true that _now_ there appear to be no > > memory leaks, or related races with the controller, we got there by > > removing complexity ... like the complexity of two memory allocations > > for each QH. (Or QTD, or ITD, or SITD ... you'd need to change all of > > those if the rationale for this change were good.) > > ...at the tradeoff of a Lurking Untyped Horror in kernel code that > supposedly has to be bulletproof.
Nope; not a tradeoff. For one thing, the pointers _are_ typed; for another, we have no option to trade _to_ since the hardware requires using those typed pointers. > Yes, Intel thrust some of that upon > us in the way the hw_ptrs are structured, but to embrace it to the > extent we have is not only the equivalent of storing armed mousetraps > in front of your keyboard, it substantially increases the complexity > of every schedule walking operation. I'll disagree with that. Since typed pointer model is inescapable in hardware, we have to cope with it ... and the way it's currently done ensures that we never have the nasty situation of software traversal working, where hardware traversal doesn't. On top of that, the traversals are easily encapsulated ... so that it's a case of "get it right once, then don't touch the code". Just like <linux/list.h>, pagetables, and similar complex data structure. - Dave ------------------------------------------------------------------------- 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