diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2015-01-16 20:05:34 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-02-02 18:11:26 (GMT) |
commit | 2c5dc4641ca0e046b432f94f7058c4aff3440e47 (patch) | |
tree | 7761dc343a76521f50742234aa996314f2060a32 /drivers/sbus | |
parent | 62d38099bf9dd0bdb582369b3cd049b67a0f1ac1 (diff) | |
download | linux-2c5dc4641ca0e046b432f94f7058c4aff3440e47.tar.xz |
n_tty: Eliminate receive_room() from consumer/exclusive paths
The input worker never reschedules itself; it only processes input until
either there is no more input or the read buffer is full. So the reader
is responsible for restarting the input worker only if the read buffer
was previously full (no_room == 1) _and_ space is now available to process
more input because the reader has consumed data from the read buffer.
However, computing the actual space available is not required to determine
if the reader has consumed data from the read buffer. This condition is
evaluated in 5 situations, each of which the space avail is already known:
1. n_tty_flush_buffer() - the read buffer is empty; kick the worker
2. n_tty_set_termios() - no data has been consumed; do not kick the worker
(although it may have kicked the reader so data _will be_ consumed)
3. n_tty_check_unthrottle - avail space > 3968; kick the worker
4. n_tty_read, before leaving - only kick the worker if the reader has
moved the tail. This prevents unnecessarily kicking the worker
when timeout-style reading is used.
5. n_tty_read, before sleeping - although it is possible for the read
buffer to be full and input_available_p() to be false, this can
only happen when the input worker is racing the reader, in which
case the reader will have been woken and won't sleep.
Rename n_tty_set_room() to n_tty_kick_worker() to reflect what the
function actually does.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/sbus')
0 files changed, 0 insertions, 0 deletions