On Saturday 21 May 2005 4:41 pm, Pete Zaitcev wrote:
> On Sat, 21 May 2005 18:06:08 -0400, Glenn Maynard <[EMAIL PROTECTED]> wrote:
> 
> > I seem to recall you saying, at some point, that scatter-gather may now be
> > reliable enough for ub to use; could that at least bring performance up to
> > usable levels, even if it doesn't fix this?  (I can't find where you might
> > have said that, though, so I might be imagining things.)
> 
> I don't know if it's reliable or not, it is to be tested.

It's reliable enough to regularly pass regression/stress tests;
and usb-storage uses it all the time.  It's been in heavy use
for several years now too.  Most people would call that "reliable",
given the strong lack of error reports.


> But the 
> main problem is that the current USB s/g API is not useable outside
> of a process context. Some refactoring is needed before ub can us it.

There's only one call that demands a process context, usb_sg_wait().
The other two calls don't need one at all.  You'd be better off
writing new functions than changing the usb_sg_wait() internals,
IMO, since there are some tricky fault cases to recover from.
Even though everything's been pre-allocated ... ;)


> A secondary problem is that the API allows no preallocations, which
> I like to use ever since the PF_MEMALLOC story.

I don't know what you're talking about.  usb_sg_init() preallocates
everything that usbcore allows to be pre-allocated.  It's one of the
very few USB APIs that even pays attention to that issue, in fact.


The only thing that isn't pre-allocated is the data used internally
to the HCDs, which is has always been dynamically allocated when an
URB gets submitted.   The DMA descriptors are normally available,
once the systems been in use for a while, since they come from a
never-shrinks DMA pool.  (Which, for OHCI and EHCI, tends to start
out quite oversized, and stay that way.)  HCDs that use urb->hcpriv
sometimes need to kmalloc that though; that's more likely to block.

That HCD-internal data can't be pre-allocated with the current URB
API, because URBs aren't even coupled to devices (much less buffers!)
until very late.  It'd be nice to fix that someday, but it's never
been clear that was a real problem ... or if it is, where to fix it.

- Dave














-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
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