summaryrefslogtreecommitdiff
path: root/drivers/char/vt.c
diff options
context:
space:
mode:
authorJoe Peterson <joe@skyrush.com>2009-01-02 16:40:53 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-02 21:19:35 +0300
commita88a69c91256418c5907c2f1f8a0ec0a36f9e6cc (patch)
treecc595c2c67b1d070e6897bac4098702c164feb39 /drivers/char/vt.c
parente482a2378f3d1aef7fa8942f8f163078f01bb456 (diff)
downloadlinux-a88a69c91256418c5907c2f1f8a0ec0a36f9e6cc.tar.xz
n_tty: Fix loss of echoed characters and remove bkl from n_tty
Fixes the loss of echoed (and other ldisc-generated characters) when the tty is stopped or when the driver output buffer is full (happens frequently for input during continuous program output, such as ^C) and removes the Big Kernel Lock from the N_TTY line discipline. Adds an "echo buffer" to the N_TTY line discipline that handles all ldisc-generated output (including echoed characters). Along with the loss of characters, this also fixes the associated loss of sync between tty output and the ldisc state when characters cannot be immediately written to the tty driver. The echo buffer stores (in addition to characters) state operations that need to be done at the time of character output (like management of the column position). This allows echo to cooperate correctly with program output, since the ldisc state remains consistent with actual characters written. Since the echo buffer code now isolates the tty column state code to the process_out* and process_echoes functions, we can remove the Big Kernel Lock (BKL) and replace it with mutex locks. Highlights are: * Handles echo (and other ldisc output) when tty driver buffer is full - continuous program output can block echo * Saves echo when tty is in stopped state (e.g. ^S) - (e.g.: ^Q will correctly cause held characters to be released for output) * Control character pairs (e.g. "^C") are treated atomically and not split up by interleaved program output * Line discipline state is kept consistent with characters sent to the tty driver * Remove the big kernel lock (BKL) from N_TTY line discipline Signed-off-by: Joe Peterson <joe@skyrush.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/vt.c')
-rw-r--r--drivers/char/vt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 008176edbd64..639e126b2bff 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2679,7 +2679,7 @@ static int con_write_room(struct tty_struct *tty)
{
if (tty->stopped)
return 0;
- return 4096; /* No limit, really; we're not buffering */
+ return 32768; /* No limit, really; we're not buffering */
}
static int con_chars_in_buffer(struct tty_struct *tty)