On Friday 29 October 2004 18:50, Johannes Erdfelt wrote: > On Fri, Oct 29, 2004, Duncan Sands <[EMAIL PROTECTED]> wrote: > > > It probably will be significantly less. We have buffer size issues with > > > usbfs and libusb. > > > > > > Older versions of libusb used the synchronous bulk read/write calls and > > > those were limited to a page size. We've since switched to using > > > asynchronous, URB based calls, which allow us buffer sizes of up to > > > 16KB, but I think that will still limit us to quite a bit under 30MB/s. > > > > > > We can go even further by using multiple URBs and queuing them, but > > > libusb doesn't currently do that. > > > > Hi Johannes, maybe it should allocate multiple pages and then use scatter-gather > > io out of them. That avoids having to allocate large contiguous lumps of kernel > > memory, and should also be good for performance. > > Are you talking about exporting scatter-gather via usbfs? Or having the > kernel avoid a copy from userspace by using scatter-gather internally? > > The former might be useful, but only if the application really goes out > of the way to use it. > > The latter sounds good, but might be tricky. Scatter-gather implies > properly sized buffers to ensure the correct packetization, which I > don't think userspace could guarantee.
Neither! Right now usbfs allocates a buffer (max size: 16k), and copies the data from user-space. The problem is that this requires finding several contiguous pages of kernel memory (max: 5 pages). I'm worried about memory pressure here. If usbfs instead grabbed a bunch of non-contiguous pages, copied the data into them from user-space, and then sent it (using scatter-gather io), then there is no longer any memory pressure problem. What's more, there would also be no reason not to increase the maximum data size from 16k to something much bigger, say 256k. Allowing bigger buffers should increase performance. All the best, Duncan. ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel