• Peter Hurley's avatar
    n_tty: Process echoes in blocks · cbfd0340
    Peter Hurley authored
    
    
    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: default avatarPeter Hurley <peter@hurleysoftware.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    cbfd0340
n_tty.c 57.8 KB