]> git.baikalelectronics.ru Git - kernel.git/commit
n_tty: Process echoes in blocks
authorPeter Hurley <peter@hurleysoftware.com>
Sat, 15 Jun 2013 14:04:26 +0000 (10:04 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jul 2013 00:02:21 +0000 (17:02 -0700)
commit1a16a04d625642f16886bdb368c780e7a9cab92a
treee7663ed78f91daf7e1d441d28e2644d0dffeded5
parentf961ff7b161f4a2dee5d815ac85e6d0dbc88262b
n_tty: Process echoes in blocks

Byte-by-byte echo output is painfully slow, requiring a lock/unlock
cycle for every input byte.

Instead, perform the echo output in blocks of 256 characters, and
at least once per flip buffer receive. Enough space is reserved in
the echo buffer to guarantee a full block can be saved without
overrunning the echo output. Overrun is prevented by discarding
the oldest echoes until enough space exists in the echo buffer
to receive at least a full block of new echoes.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c