• Arnd Bergmann's avatar
    tty: improve tty_insert_flip_char() slow path · 065ea0a7
    Arnd Bergmann authored
    While working on improving the fast path of tty_insert_flip_char(),
    I noticed that by calling tty_buffer_request_room(), we needlessly
    move to the separate flag buffer mode for the tty, even when all
    characters use TTY_NORMAL as the flag.
    
    This changes the code to call __tty_buffer_request_room() with the
    correct flag, which will then allocate a regular buffer when it rounds
    out of space but no special flags have been used. I'm guessing that
    this is the behavior that Peter Hurley intended when he introduced
    the compacted flip buffers.
    
    Fixes: acc0f67f ("tty: Halve flip buffer GFP_ATOMIC memory consumption")
    Cc: Peter Hurley <peter@hurleysoftware.com>
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    065ea0a7
tty_buffer.c 15.9 KB