• Johan Hovold's avatar
    USB: serial: reimplement generic fifo-based writes · 27c7acf2
    Johan Hovold authored
    Reimplement fifo-based writes in the generic driver using a multiple
    pre-allocated urb scheme.
    
    In contrast to multi-urb writes, no allocations (of urbs or buffers) are
    made during run-time and there is less pressure on the host stack
    queues as currently only two urbs are used (implementation is generic
    and can handle more than two urbs as well, though).
    
    Initial tests using ftdi_sio show that the implementation achieves the
    same (maximum) throughput at high baudrates as multi-urb writes. The CPU
    usage is much lower than for multi-urb writes for small write requests
    and only slightly higher for large (e.g. 2k) requests (due to extra copy
    via fifo?).
    
    Also outperforms multi-urb writes for small write requests on an
    embedded arm-9 system, where multi-urb writes are CPU-bound at high
    baudrates (perf reveals that a lot of time is spent in the host stack
    enqueue function -- could perhaps be a bug as well).
    
    Keeping the original write_urb, buffer and flag for now as there are
    other drivers depending on them.
    Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    27c7acf2
usb-serial.c 37.3 KB