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)
commitcbfd0340ae1993378fd47179db949e050e16e697
treee7663ed78f91daf7e1d441d28e2644d0dffeded5
parent019ebdf9f26fd2e43b9e1af576835183e95dc82e
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