Re: [RFC][PATCH 0/2] USB: serial: unify generic write implementations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 19, 2010 at 10:35:11AM -0400, Alan Stern wrote:
> On Thu, 18 Mar 2010, Johan Hovold wrote:
> 
> > Hi, 
> > 
> > A while back I did some initial attempts at unifying the single-urb fifo-based
> > and the multi-urb dynamically-allocated urb write implementations, but although
> > the performance results were promising my design at the time was a bit too complex.
> > 
> > I decided to postpone this and instead turn ftdi_sio into a kfifo-based
> > generic driver first, but I soon realised that a single urb would not suffice to
> > achieve maximum throughput.
> > 
> > So I kept both schemes to avoid any regressions and instead made the
> > prepare_write_buffer interface fit them both.
> > 
> > Today I thought some more about the unification and came up with a new design
> > that is both simple and clean, and that not only achieves maximum throughput
> > but also does so at significantly lower CPU-usage for small writes (and only
> > slightly higher for 2k ones). It currently uses two pre-allocated urbs (and
> > buffers) so in contrast to the current multi-urb writes it does no allocations
> > during runtime and also puts less pressure on the host-stack queues.
> > 
> > This also simplifies the prepare_write_buffer interface.
> 
> Wow!  My suggestion sure got some quick results.  The performance
> results sound impressive.

Thanks.

As I mentioned I had already done some work on it, but sometimes not
working on something for a while can actually help to make the final
pieces fall into place. :)

And I wasn't quite happy with the semantics of the first version of
prepare_write_urb either.

Performance increase is simply due to the fact that it is more efficient
to send 256b of bulk data at a time than say 10b (or 1b), and for high
baudrates you may also need more than one urb to keep the device buffers
filled.

Johan

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux