]> 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)
commit1d0cca54b1dd573e06e3ed34db6751394f8e132d
treee7663ed78f91daf7e1d441d28e2644d0dffeded5
parent40917d5350834e3daaaf3ad98716f466caf3c250
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