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

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

 



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.

These patches apply on top of the series I posted yesterday, and with them
included the diff-stat for the whole series is:

 drivers/usb/serial/aircable.c   |  499 ++++-----------------------------------
 drivers/usb/serial/cp210x.c     |   16 +-
 drivers/usb/serial/ftdi_sio.c   |  388 ++++---------------------------
 drivers/usb/serial/generic.c    |  304 +++++++-----------------
 drivers/usb/serial/pl2303.c     |  421 ++------------------------------
 drivers/usb/serial/usb-serial.c |   36 +++-
 drivers/usb/serial/usb_debug.c  |    4 +-
 include/linux/usb/serial.h      |   25 ++-
 8 files changed, 260 insertions(+), 1433 deletions(-)


Thanks,
Johan



Johan Hovold (2):
  USB: serial: reimplement generic fifo-based writes
  USB: serial: remove multi-urb write from generic driver

 drivers/usb/serial/aircable.c   |    9 +-
 drivers/usb/serial/ftdi_sio.c   |   57 ++++--------
 drivers/usb/serial/generic.c    |  192 +++++++++++----------------------------
 drivers/usb/serial/usb-serial.c |   34 +++++++-
 include/linux/usb/serial.h      |   16 ++-
 5 files changed, 121 insertions(+), 187 deletions(-)

--
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